* {
  box-sizing: border-box;
}

/* Global body layout and typography */
body {
  margin: 0;
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================================
   Intro pages
   ================================ */

body.intro-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;

  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  color: #111111;
  background-color: #f5f5f5; /* 万一图载不出来的兜底色 */
}

/* Intro1 专用背景图 */
body.intro1 {
  background-image: url("intro1bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* 中央内容容器 */
.intro-page .intro-container {
  width: 100%;
  max-width: 720px;
  padding: 2.5rem 2rem;
}

.intro-page .intro-card {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 24px;
  padding: 2.2rem 2.4rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

/* Intro2 专用背景图 */
body.intro2 {
  background-image: url("intro2bg.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* 标题：用 Pixelify Sans */
.intro-page .intro-title {
  margin: 0 0 1.2rem;
  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  font-size: 2.1rem;
  letter-spacing: 0.08em;
}

/* 主体文案 */
.intro-page .intro-text {
  margin: 0 0 0.9rem;
  font-size: 0.98rem;
  line-height: 1.8;
  opacity: 0.95;
}

/* 进入 chapter 的链接按钮 */
.intro-page .intro-start-link {
  display: inline-block;
  margin-top: 1.4rem;
  padding: 0.7rem 1.7rem;
  border-radius: 999px;
  text-decoration: none;

  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  font-size: 0.95rem;

  background: #111111;
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

/* 简单响应式 */
@media (max-width: 768px) {
  .intro-page .intro-container {
    padding: 1.8rem 1.2rem;
  }

  .intro-page .intro-card {
    padding: 1.8rem 1.6rem;
  }

  .intro-page .intro-title {
    font-size: 1.8rem;
  }
}

/* ---------- Backgrounds for different pages ---------- */

body.page-home {
  background-image: url("dandelicat.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Page 1: dark background + white text */
body.page-1 {
  background-image: url("1bg.PNG");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #ffffff;
}

/* Page 2: dark background + white text */
body.page-2 {
  background-image: url("2bg.PNG");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #ffffff;
}

/* Page 3: dark background + white text */
body.page-3 {
  background-image: url("3bg.PNG");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #ffffff;
}

/* ---------- Home page layout (index) ---------- */

/* Main layout on the home page: left + right columns */
.app {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3.5rem;
  padding: 3rem 4.5rem;
  width: 100%;
  max-width: 1400px;
}

/* Left side: logo + short tagline */
.hero-left {
  max-width: 380px;
  color: #111111;
  margin-top: 1.2rem;
}

/* Logo title on home: Pixelify Sans */
.logo {
  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(4.8rem, 4.8vw, 3.4rem);
  margin: 0 0 0.7rem;
}

/* Tagline under the logo */
.subtitle {
  margin: 0;
  opacity: 0.9;
  font-size: 1.65rem;
  line-height: 1.6;
}

/* Right side: intro + button on a subtle glass card */
.hero-right {
  max-width: 430px;
  color: #ffffff;
  text-align: left;

  background: rgba(0, 0, 0, 0.4);
  padding: 1.4rem 1.6rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);

  margin-left: auto;
  transform: translateX(80px);
}

/* ---------- Home page fine-tuning ---------- */

/* 只在首页调整整体左右位置 */
body.page-home .app {
  padding: 3rem 8rem 3rem 2.5rem;
}

/* 只在首页把右边的 intro 卡片再推远一点 */
body.page-home .hero-right {
  transform: translateX(180px);
}

/* Intro text */
.intro {
  font-size: 1.35rem;
  line-height: 1.8;
  margin: 0 0 1.6rem;
}

/* 首页 chapter 按钮组 */
.chapter-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
  width: 100%;
}

.chapter-buttons-label {
  margin: 0 0 0.2rem;
  font-size: 0.88rem;
  line-height: 1.5;
  opacity: 0.82;
  letter-spacing: 0.02em;
}

.chapter-buttons-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  width: 100%;
}

.chapter-buttons-bottom {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 0.2rem;
}

/* 首页按钮专属样式 */
body.page-home .chapter-buttons .button-primary {
  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-width: 0;
  padding: 0.95rem 1.2rem;

  border: none;
  border-radius: 999px;

  text-align: center;
  font-size: 0.95rem;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;

  background: rgba(255, 255, 255, 0.92);
  color: #111111;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);

  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease,
    box-shadow 0.18s ease;
}

body.page-home .chapter-buttons .button-primary:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

/* Cat home 单独一行，稍微窄一点更像“后续解锁” */
body.page-home .chapter-buttons-bottom .button-primary {
  width: 72%;
}

/* locked 状态 */
body.page-home .chapter-buttons .button-primary.chapter-locked,
body.page-home .chapter-buttons .button-primary:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.55);
  color: rgba(17, 17, 17, 0.72);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  transform: none;
  filter: saturate(0.7);
}

body.page-home .chapter-buttons .button-primary.chapter-locked:hover,
body.page-home .chapter-buttons .button-primary:disabled:hover {
  background: rgba(255, 255, 255, 0.55);
  transform: none;
}

/* =========================================
   Landing page (index)
   ========================================= */

   body.page-home .landing-page {
    min-height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    padding: 0 2rem;
  }
  
  body.page-home .landing-content {
    position: relative;
    z-index: 3;
    width: min(92vw, 980px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 3.6rem;
    padding-bottom: 3rem;
  }
  
  body.page-home .landing-logo {
    margin: 0;
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    font-weight: 600;
    font-size: clamp(4.6rem, 8vw, 7.2rem);
    line-height: 0.95;
    color: #111111;
  
    /* 让黑字不融进背景 */
    -webkit-text-stroke: 2px rgba(255, 255, 255, 0.72);
    paint-order: stroke fill;
    text-shadow: 0 2px 12px rgba(255, 255, 255, 0.18);
  }
  
  body.page-home .landing-subtitle {
    margin: 1.15rem 0 0;
    max-width: 640px;
    padding: 0.7rem 1.2rem;
    border-radius: 999px;
  
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: 1.18rem;
    line-height: 1.6;
    color: #111111;
  
    background: rgba(255, 255, 255, 0.36);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  }
  
  body.page-home .landing-enter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  
    min-width: 190px;
    padding: 0.95rem 2.2rem;
    border-radius: 999px;
    text-decoration: none;
  
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1;
    color: #111111;
    background: rgba(255, 255, 255, 0.92);
  
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    transition: transform 0.18s ease, background 0.18s ease,
      box-shadow 0.18s ease;
  
    /* 关键：把按钮推到更靠下、猫头下方 */
    margin-top: auto;
    margin-bottom: 8.4rem;
  }
  
  body.page-home .landing-enter-button:hover {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  }
  
  @media (max-width: 768px) {
    body.page-home .landing-content {
      padding-top: 2.8rem;
      padding-bottom: 2rem;
    }
  
    body.page-home .landing-logo {
      font-size: clamp(3.4rem, 13vw, 5rem);
      -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.72);
    }
  
    body.page-home .landing-subtitle {
      max-width: 92%;
      font-size: 1rem;
      line-height: 1.55;
      padding: 0.75rem 1rem;
    }
  
    body.page-home .landing-enter-button {
      margin-bottom: 5.4rem;
    }
  }

  /* =========================================
   Hub page
   ========================================= */

body.page-hub {
  margin: 0;
  min-height: 100vh;
  display: block;
  background-image: url("dandelicat.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #111111;
}

body.page-hub .hub-page {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

body.page-hub .hub-card {
  width: min(92vw, 760px);
  text-align: center;
  padding: 2.4rem 2rem 2rem;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

body.page-hub .hub-logo {
  margin: 0;
  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 1;
  color: #111111;
}

body.page-hub .hub-intro {
  margin: 1.2rem auto 0;
  max-width: 620px;
  font-size: 1.05rem;
  line-height: 1.85;
  color: #111111;
}

body.page-hub .hub-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
  width: 100%;
}

body.page-hub .hub-buttons-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  width: 100%;
}

body.page-hub .hub-buttons-bottom {
  display: flex;
  justify-content: center;
  width: 100%;
}

body.page-hub .hub-button {
  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-width: 0;
  padding: 0.95rem 1.2rem;

  border: none;
  border-radius: 999px;

  text-align: center;
  font-size: 0.95rem;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;

  background: rgba(17, 17, 17, 0.92);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);

  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease,
    box-shadow 0.18s ease;
}

body.page-hub .hub-button:hover {
  background: #111111;
  transform: translateY(-1px);
}

body.page-hub .hub-buttons-bottom .hub-button {
  width: 72%;
}

/* locked state */
body.page-hub .hub-button.chapter-locked,
body.page-hub .hub-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  background: rgba(17, 17, 17, 0.45);
  color: rgba(255, 255, 255, 0.78);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transform: none;
  filter: saturate(0.7);
}

body.page-hub .hub-button.chapter-locked:hover,
body.page-hub .hub-button:disabled:hover {
  background: rgba(17, 17, 17, 0.45);
  transform: none;
}

body.page-hub .hub-back-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: #111111;
  opacity: 0.72;
  text-decoration: none;
}

body.page-hub .hub-back-link:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  body.page-hub .hub-page {
    padding: 1.2rem;
  }

  body.page-hub .hub-card {
    padding: 1.8rem 1.2rem 1.6rem;
  }

  body.page-hub .hub-buttons {
    margin-top: 1.7rem;
  }

  body.page-hub .hub-buttons-top {
    grid-template-columns: 1fr;
  }

  body.page-hub .hub-buttons-bottom .hub-button {
    width: 100%;
  }

  body.page-hub .hub-intro {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.75;
  }
}

/* locked chapter button */
.chapter-locked,
button.chapter-locked,
.button-primary.chapter-locked {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
  pointer-events: none;
}

.chapter-complete {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.7),
    0 0 18px rgba(158, 216, 255, 0.45);
}

/* clear progress button */
.hub-clear-button {
  margin: 1.1rem auto 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0.62rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(31, 42, 68, 0.18);

  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  font-size: 0.85rem;

  background: rgba(255, 255, 255, 0.68);
  color: #1f2a44;
  cursor: pointer;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hub-clear-button:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* =========================================
   Chapter 2 – shared drag page visuals
   page1 / page2 / page3
   ========================================= */

/* Shared background for all Chapter 2 drag pages */
body.page-1.language-drag-page,
body.page-2.language-drag-page,
body.page-3.language-drag-page {
  margin: 0;
  min-height: 100vh;
  display: block;
  background-image: url("c2bg.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #ffffff;
}

/* Main layout */
body.language-drag-page .language-page {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  padding: 1.2rem 2rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

/* ---------- top ---------- */

body.language-drag-page .language-header {
  position: relative;
  z-index: 40;
  text-align: center;
  margin-top: 0;
}

body.language-drag-page .language-logo {
  margin: 0;
  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  font-weight: 600;
  font-size: clamp(2.8rem, 5vw, 4rem);
  line-height: 1;
  color: #1f2831;
  text-shadow: 0 2px 14px rgba(255, 255, 255, 0.42);
}

body.language-drag-page .language-status {
  margin: 0.7rem 0 0;
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0.96;
  color: #1f2831;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.32);
}

/* ---------- hint ---------- */

body.language-drag-page .language-hint-section {
  position: relative;
  z-index: 40;
  margin-top: 0.8rem;
  text-align: center;
  max-width: 720px;
}

body.language-drag-page .language-copy {
  margin: 0 auto;
  max-width: 650px;
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 400;
  opacity: 0.92;
  color: #1f2831;
  text-shadow: 0 2px 10px rgba(255, 255, 255, 0.34);
}

body.language-drag-page .language-hint-text {
  margin: 1rem 0 0;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 700;
  color: #1f2831;
  text-align: center;
  letter-spacing: 0;
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.36);
}

/* ---------- stage ---------- */

body.language-drag-page .language-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

/* cat + brain stage */
body.language-drag-page .cat-stage {
  position: absolute;
  left: 50%;

  /* 调整整只猫+脑子上下位置：
     数字越大越往下，越小越往上 */
  top: 55%;

  transform: translate(-50%, -50%);
  width: min(104vw, 1260px);
  height: min(80vw, 900px);

  display: flex;
  align-items: center;
  justify-content: center;
}

/* cat layer: in front of brain */
body.language-drag-page .cat-head-placeholder {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

body.language-drag-page .cat-image {
  width: min(98vw, 1180px);
  max-width: 1180px;
  height: auto;
  object-fit: contain;
  transition: opacity 0.25s ease;
  pointer-events: none;
  user-select: none;
}

/* brain drop zone: visual brain image + invisible hit area */
body.language-drag-page .brain-dropzone {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);

  width: min(88vw, 980px);
  height: min(60vw, 720px);

  z-index: 8;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  background-image: url("brain.png");
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;

  border: none;
  border-radius: 999px;
  box-shadow: none;
  padding: 0;
}

/* Page-specific brain images */
body.page-2.language-drag-page .brain-dropzone {
  background-image: url("brain2.png");
}

body.page-3.language-drag-page .brain-dropzone {
  background-image: url("brain3.png");
}

/* optional image tag support if we add <img class="brain-image"> later */
body.language-drag-page .brain-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
}

/* hide old label by default */
body.language-drag-page .dropzone-label {
  display: none;
}

/* active / correct / wrong feedback around brain */
body.language-drag-page .brain-dropzone.is-active {
  filter: drop-shadow(0 0 18px rgba(198, 255, 160, 0.55));
}

body.language-drag-page .brain-dropzone.is-correct {
  filter:
    drop-shadow(0 0 14px rgba(198, 255, 160, 0.7))
    drop-shadow(0 0 30px rgba(198, 255, 160, 0.35));
}

body.language-drag-page .brain-dropzone.is-wrong {
  filter:
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.55))
    saturate(0.7);
}

/* ---------- patches ---------- */

body.language-drag-page .language-patches {
  position: absolute;
  inset: 0;
  z-index: 30;
}

/* draggable patch */
body.language-drag-page .language-patch {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  cursor: grab;
  user-select: none;
  touch-action: none;

  transition:
    transform 0.22s ease,
    opacity 0.22s ease,
    filter 0.22s ease;

  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  will-change: transform;
}

body.language-drag-page .language-patch:active {
  cursor: grabbing;
}

body.language-drag-page .language-patch.is-dragging {
  animation: none !important;
  transform: scale(1.04);
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.28));
  z-index: 80;
}

body.language-drag-page .language-patch.is-installed {
  animation: none !important;
  opacity: 0.35;
  pointer-events: none;
}

body.language-drag-page .language-patch.is-hinted {
  filter:
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.24))
    drop-shadow(0 8px 18px rgba(0, 0, 0, 0.2));
}

/* old CSS stem hidden because c2patch.png contains the patch visual */
body.language-drag-page .patch-stem {
  display: none;
}

/* patch image card */
body.language-drag-page .patch-card {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* patch 大小：要更大就改 260/208 */
  width: 300px;
  height: 260px;
  padding: 0.8rem 1rem 1.1rem;

  background-image: url("c2patch.png");
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  background-color: transparent;

  border-radius: 0;
  box-shadow: none;

  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  font-size: 1.75rem;
  line-height: 1;
  color: #111111;
  text-align: center;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.45),
    0 0 8px rgba(255, 255, 255, 0.2);
}

/* If later we wrap text in .patch-label, this will still work */
body.language-drag-page .patch-label {
  position: relative;
  z-index: 2;

  /* 文字在 patch 图片里的位置：
     数字越大越往下 */
  transform: translateY(8px);
}

/* patch float animations */
@keyframes patchFloatA {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(4px, -6px) rotate(-1deg);
  }
  50% {
    transform: translate(0px, -10px) rotate(1deg);
  }
  75% {
    transform: translate(-4px, -5px) rotate(-0.5deg);
  }
}

@keyframes patchFloatB {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-5px, -4px) rotate(1deg);
  }
  50% {
    transform: translate(3px, -9px) rotate(-1deg);
  }
  75% {
    transform: translate(-2px, -6px) rotate(0.5deg);
  }
}

@keyframes patchFloatC {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  20% {
    transform: translate(3px, -5px) rotate(-0.8deg);
  }
  50% {
    transform: translate(-3px, -11px) rotate(0.8deg);
  }
  80% {
    transform: translate(2px, -4px) rotate(-0.4deg);
  }
}

/* ---------- page 1 patch positions ---------- */

body.page-1.language-drag-page .patch-peaceful {
  left: 8%;
  top: 47%;
  animation: patchFloatA 4.8s ease-in-out infinite;
}

body.page-1.language-drag-page .patch-sad {
  left: 18%;
  top: 24%;
  animation: patchFloatB 4.1s ease-in-out infinite;
}

body.page-1.language-drag-page .patch-happy {
  left: 75%;
  top: 36%;
  animation: patchFloatC 5.2s ease-in-out infinite;
}

/* ---------- page 2 patch positions ---------- */
/* correct answer: soft -> left bottom */

body.page-2.language-drag-page .patch-cold {
  left: 75%;
  top: 30%;
  animation: patchFloatA 4.7s ease-in-out infinite;
}

body.page-2.language-drag-page .patch-soft {
  left: 8%;
  top: 58%;
  animation: patchFloatC 5s ease-in-out infinite;
}

body.page-2.language-drag-page .patch-heavy {
  left: 10%;
  top: 32%;
  animation: patchFloatB 4.2s ease-in-out infinite;
}

body.page-2.language-drag-page .patch-loud {
  left: 73%;
  top: 57%;
  animation: patchFloatA 5.3s ease-in-out infinite;
}

/* ---------- page 3 patch positions ---------- */
/* correct answer: cloudy -> left top */

body.page-3.language-drag-page .patch-cloudy {
  left: 8%;
  top: 32%;
  animation: patchFloatC 5s ease-in-out infinite;
}

body.page-3.language-drag-page .patch-bright {
  left: 75%;
  top: 30%;
  animation: patchFloatA 4.8s ease-in-out infinite;
}

body.page-3.language-drag-page .patch-empty {
  left: 10%;
  top: 59%;
  animation: patchFloatB 4.2s ease-in-out infinite;
}

body.page-3.language-drag-page .patch-noisy {
  left: 73%;
  top: 57%;
  animation: patchFloatA 5.3s ease-in-out infinite;
}

/* brain hint text */
.brain-dropzone {
  position: absolute;
}

/* brain planting hint */
body.language-drag-page .brain-dropzone .brain-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  font-size: clamp(1.3rem, 2.1vw, 2.1rem);
  font-weight: 600;

  color: #11334b;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.9),
    0 2px 0 rgba(255, 255, 255, 0.65),
    0 0 18px rgba(59, 159, 232, 0.45);

  letter-spacing: 0.03em;
  white-space: nowrap;

  opacity: 0;
  pointer-events: none;
  z-index: 50;

  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

body.language-drag-page .brain-dropzone .brain-hint.is-visible {
  opacity: 1;
  transform: translate(-50%, -62%);
}

@keyframes brainHintPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -40%);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -60%);
  }
}

.brain-hint.is-visible {
  animation: brainHintPop 0.22s ease;
}

/* ---------- actions ---------- */
/* HTML 里如果已经删掉 Skip For Now，这里不会影响。
   如果某页还残留 language-actions，也强制隐藏。 */

body.language-drag-page .language-actions {
  display: none;
}

/* ---------- correct patch yeah popup ---------- */

.correct-cat-popup {
  position: fixed;
  inset: 0;
  z-index: 9997;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.correct-cat-popup.visible {
  opacity: 1;
  transform: scale(1);
}

.correct-cat-popup.hidden {
  opacity: 0;
  transform: scale(0.96);
}

.correct-cat-popup .correct-popup-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

.correct-cat-popup img {
  width: min(46vw, 420px);
  max-width: 420px;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.28));
}

.correct-cat-popup p {
  margin: 0;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  font-size: 1rem;
  color: #111111;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

/* ---------- wrong patch sad cat popup ---------- */

/* wrong patch popup */
.wrong-cat-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 9999;

  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0;
  pointer-events: none;

  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.wrong-cat-popup.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.wrong-cat-popup.hidden {
  display: none;
}

.wrong-cat-popup img {
  width: min(70vw, 720px);
  height: auto;
  display: block;

  filter:
    drop-shadow(0 18px 36px rgba(0, 0, 0, 0.18))
    drop-shadow(0 0 22px rgba(255, 255, 255, 0.75));
}

/* ---------- responsive ---------- */

@media (max-width: 768px) {
  body.language-drag-page .language-page {
    padding: 1.4rem 1rem 1.2rem;
  }

  body.language-drag-page .language-logo {
    font-size: 2.35rem;
  }

  body.language-drag-page .language-status {
    font-size: 0.95rem;
  }

  body.language-drag-page .language-hint-section {
    margin-top: 1rem;
    max-width: 92vw;
  }

  body.language-drag-page .language-copy {
    font-size: 0.94rem;
    line-height: 1.65;
  }

  body.language-drag-page .language-hint-text {
    font-size: 1.28rem;
  }

  body.language-drag-page .cat-stage {
    top: 60%;
    width: min(108vw, 720px);
    height: 540px;
  }

  body.language-drag-page .cat-image {
    width: min(108vw, 700px);
  }

  body.language-drag-page .brain-dropzone {
    top: 11%;
    width: 92%;
    height: 58%;
  }

  body.language-drag-page .patch-card {
    width: 150px;
    height: 120px;
    font-size: 1.15rem;
    padding: 0.55rem 0.75rem 0.8rem;
  }

  body.page-1.language-drag-page .patch-peaceful {
    left: 0%;
    top: 51%;
  }

  body.page-1.language-drag-page .patch-sad {
    left: 24%;
    top: 27%;
  }

  body.page-1.language-drag-page .patch-happy {
    left: 66%;
    top: 40%;
  }

  body.page-2.language-drag-page .patch-cold {
    left: 0%;
    top: 35%;
  }

  body.page-2.language-drag-page .patch-soft {
    left: 64%;
    top: 32%;
  }

  body.page-2.language-drag-page .patch-heavy {
    left: 1%;
    top: 63%;
  }

  body.page-2.language-drag-page .patch-loud {
    left: 64%;
    top: 62%;
  }

  body.page-3.language-drag-page .patch-cloudy {
    left: 64%;
    top: 32%;
  }

  body.page-3.language-drag-page .patch-bright {
    left: 0%;
    top: 35%;
  }

  body.page-3.language-drag-page .patch-empty {
    left: 1%;
    top: 63%;
  }

  body.page-3.language-drag-page .patch-noisy {
    left: 64%;
    top: 62%;
  }

  .wrong-cat-popup img {
    width: min(72vw, 340px);
  }
}

/* Cat image transition */
.cat-image {
  transition: opacity 0.25s ease;
}

/* =========================================
   Loading screen
   ========================================= */

.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  z-index: 9998;
}

.loading-panel {
  min-width: 300px;
  max-width: 420px;
  padding: 1.4rem 1.6rem 1.3rem;
  border-radius: 22px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.loading-theme-light .loading-panel {
  background: rgba(255, 255, 255, 0.72);
  color: #111111;
}

.loading-theme-dark .loading-panel {
  background: rgba(0, 0, 0, 0.34);
  color: #ffffff;
}

.loading-label {
  margin: 0 0 0.8rem;
  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.95;
}

.loading-dots {
  display: inline-flex;
  gap: 0.35rem;
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 0.6rem;
}

.loading-dots span {
  opacity: 0.2;
  animation: dotBlink 1s infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

.loading-bar {
  width: 260px;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  margin: 0.2rem auto 0;
}

.loading-theme-light .loading-bar {
  background: rgba(17, 17, 17, 0.14);
}

.loading-theme-dark .loading-bar {
  background: rgba(255, 255, 255, 0.22);
}

.loading-bar-fill {
  width: 0%;
  height: 100%;
  animation: loadingFill linear forwards;
}

.loading-theme-light .loading-bar-fill {
  background: #111111;
}

.loading-theme-dark .loading-bar-fill {
  background: #ffffff;
}

@keyframes loadingFill {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

@keyframes dotBlink {
  0%, 20% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}

/* =========================================
   Chapter 2 – Page 4 final screen
   ========================================= */

   body.page-4.final-page {
    margin: 0;
    min-height: 100vh;
    display: block;
  
    background-image: url("c2p4.png");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
  
    color: #ffffff;
  }
  
  body.page-4.final-page .final-page-layout {
    min-height: 100vh;
    width: 100%;
    padding: 2.2rem 2rem 2rem;
  
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  /* 顶部标题 */
  body.page-4.final-page .final-header {
    position: relative;
    z-index: 3;
    margin-top: 0.2rem;
  }
  
  body.page-4.final-page .final-logo {
    margin: 0;
  
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    font-weight: 600;
    font-size: clamp(2.8rem, 5vw, 4rem);
    line-height: 1;
  
    color: #1f2831;
    text-shadow:
      0 2px 0 rgba(255, 255, 255, 0.5),
      0 2px 14px rgba(255, 255, 255, 0.42);
  }
  
  body.page-4.final-page .final-status {
    margin: 0.7rem 0 0;
  
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 600;
  
    opacity: 0.96;
    color: #1f2831;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.32);
  }
  
  /* 中间留白：因为主视觉已经在背景图里 */
  body.page-4.final-page .final-copy-section {
    position: relative;
    z-index: 3;
  
    max-width: 680px;
  
    /* 控制 copy 在页面上的垂直位置 */
    margin-top: auto;
  
    padding: 0.85rem 1.2rem;
    border-radius: 18px;
  
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  }
  
  body.page-4.final-page .final-copy {
    margin: 0;
  
    font-size: 1rem;
    line-height: 1.8;
  
    opacity: 0.94;
    color: #1f2831;
  }
  
  /* 底部按钮 */
  body.page-4.final-page .final-actions {
    position: relative;
    z-index: 3;
  
    margin-top: 1.4rem;
    padding-bottom: 0.8rem;
  }
  
  body.page-4.final-page .final-home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  
    min-width: 190px;
    padding: 0.8rem 1.8rem;
  
    border-radius: 999px;
    text-decoration: none;
  
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    font-size: 0.95rem;
  
    background: rgba(255, 255, 255, 0.92);
    color: #111111;
  
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  
    transition:
      transform 0.18s ease,
      background 0.18s ease;
  }
  
  body.page-4.final-page .final-home-button:hover {
    background: #ffffff;
    transform: translateY(-1px);
  }

  /*  Page 4 floating words */

   body.page-4.final-page .final-stage {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
  }
  
  body.page-4.final-page .final-image-wrap {
    position: relative;
    width: 100%;
    height: 100%;
  }
  
  /* floating learned words */
  body.page-4.final-page .final-floating-word {
    position: absolute;
    z-index: 4;
  
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    font-size: clamp(1.6rem, 2.2vw, 2.5rem);
    line-height: 1;
  
    color: rgba(17, 17, 17, 0.68);
    opacity: 0.78;
    letter-spacing: 0.02em;
  
    text-shadow:
      0 2px 8px rgba(255, 255, 255, 0.35),
      0 0 14px rgba(255, 255, 255, 0.28);
  
    user-select: none;
    pointer-events: none;
  
    animation: finalWordFloat 4.2s ease-in-out infinite;
  }
  
  /* 左手附近 */
  body.page-4.final-page .word-left {
    left: 19%;
    top: 63%;
    animation-delay: 0s;
  }
  
  /* 脖子/胸前 */
  body.page-4.final-page .word-center {
    left: 50%;
    top: 55%;
    transform: translateX(-50%);
  
    font-size: clamp(1.9rem, 2.8vw, 3rem);
    opacity: 0.84;
  
    animation: finalWordFloatCenter 4.2s ease-in-out infinite;
    animation-delay: 0.8s;
  }
  
  /* 右手附近 */
  body.page-4.final-page .word-right {
    right: 19%;
    top: 63%;
    animation-delay: 1.4s;
  }
  
  @keyframes finalWordFloat {
    0%,
    100% {
      transform: translateY(0);
    }
  
    50% {
      transform: translateY(-10px);
    }
  }
  
  @keyframes finalWordFloatCenter {
    0%,
    100% {
      transform: translateX(-50%) translateY(0);
    }
  
    50% {
      transform: translateX(-50%) translateY(-10px);
    }
  }

/* ================================
   Chapter 1 – Body clock layout
   ================================ */

body.time-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;

  background-image: url("day.JPG");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  color: #111111;
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
}

/* 顶部时间块玻璃卡片 */
.time-page .time-block {
  max-width: 320px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 18px;
  padding: 0.9rem 1.2rem;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
}

/* block 里的字全部用深色 */
.time-page .time-block * {
  color: #111111;
}

.time-page .time-app {
  width: 100%;
  max-width: 1200px;
  padding: 1.8rem 4rem 4.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
}

/* 顶部三个块布局 */
.time-page .time-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
}

/* 中间标题 pill */
.time-page .time-title {
  max-width: 400px;
  min-width: 360px;
  text-align: center;
  padding: 0.9rem 2rem;
  background: rgba(255, 147, 189, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
  margin: -0.3rem auto 0;
}

.time-page .time-main-title {
  margin: 0 0 0.3rem;
  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  font-size: 2.35rem;
  letter-spacing: 0.08em;
  line-height: 1.05;
}

.time-page .time-subtitle {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  opacity: 0.78;
}

.time-page .time-block {
  max-width: 300px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 18px;
  padding: 0.85rem 1.1rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.time-page .time-label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  opacity: 0.72;
}

.time-page .time-value {
  font-size: 1.75rem;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.time-page .time-note {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  opacity: 0.9;
}

/* 中间一排：左 patch – 猫床 – 右 patch */
.time-page .time-stage {
  margin-top: 3.2rem;
  margin-bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5.5rem;
}

/* 中间容器：床 + 猫 + zzz */
.time-page .cat-bed {
  position: relative;
  width: 260px;
  height: 260px;
  background: transparent;
  box-shadow: none;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -20px;
}

/* 床 */
.time-page .bed-image {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: auto;
  z-index: 0;
}

/* 包着猫身体 + 猫头 + zzz 的区域 */
.dandelicat-area {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 猫“身体”——只负责旋转 & 投影，不要粉色圆 */
.time-page .cat-body {
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  transform-origin: 50% 100%;
  transform: rotate(-130deg);
  transition: transform 0.15s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* 猫头图片 */
.cat-head {
  position: relative;
  z-index: 2;
  width: 200px;
  height: 200px;
  object-fit: contain;
  display: block;
}

/* Zzz */
.zzz-icon {
  position: absolute;
  top: 6%;
  right: 4%;
  width: 60px;
  pointer-events: none;
  animation: floatZzz 2s ease-in-out infinite;
  transition: opacity 0.3s;
}

.zzz-icon.hidden {
  opacity: 0;
}

@keyframes floatZzz {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* 左右 patch 图片容器 */
.patch-box {
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 左右单独微调位置 */
.patch-left {
  transform: translateX(-18px);
}

.patch-right {
  transform: translateX(0);
}

.patch-left img,
.patch-right img {
  width: 300px;
  max-width: 300px;
  height: auto;
  display: block;
}

/* 下面：说明 + slider + 小时间显示 */
.time-page .slider-section {
  max-width: 440px;
  margin: 4rem auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  box-shadow: none;
}

/* 让 slider 这块在所有内容之上，防止被盖住 */
.time-page .slider-section {
  position: relative;
  z-index: 5;
}

.time-page .slider-instruction {
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 360px;
  margin: 0 auto 0.9rem;
  opacity: 0.95;
}

/* Slider */
.time-page .time-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 520px;
  height: 2px;
  border-radius: 999px;
  background: transparent;
  outline: none;
  cursor: pointer;
  margin: 0.4rem 0 0.6rem;

  position: relative;
  z-index: 10;
  pointer-events: auto;
  display: block;
}

/* 轨道改成深色 */
.time-page .time-slider::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 999px;
  background: #111827;
}

.time-page .time-slider::-moz-range-track {
  height: 2px;
  border-radius: 999px;
  background: #111827;
}

.time-page .time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ff4db0;
  border: 2px solid #ffffff;
  margin-top: -9px;
  box-shadow: 0 0 0 3px rgba(255, 77, 176, 0.3);
  cursor: pointer;
}

.time-page .time-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ff4db0;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 77, 176, 0.3);
  cursor: pointer;
}

/* Slider 下方的小时间显示 */
.time-page .time-mini-clocks {
  margin-top: 0.8rem;
  background: transparent;
  box-shadow: none;
}

.time-page .clock-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin-top: 0.15rem;
}

.time-page .slider-feedback {
  margin-top: 0.6rem;
  min-height: 1.4em;
  font-size: 0.9rem;
  text-align: center;
  opacity: 0.95;
}

/* page03 返回首页按钮 */
.time-page .body-clock-home-button {
  display: inline-block;
  margin-top: 1.8rem;
  padding: 0.6rem 1.6rem;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #111;
  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* 滑块失败的小 pop-up */
.fail-popup {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.82);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.fail-popup.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.fail-popup.hidden {
  opacity: 0;
}

/* 简单响应式 */
@media (max-width: 768px) {
  .time-page .time-app {
    padding: 1.8rem 1.4rem 2.5rem;
    gap: 2rem;
  }

  .time-page .time-header {
    flex-direction: column;
    gap: 1.4rem;
  }

  .time-page .time-block {
    max-width: none;
  }

  .time-page .time-value {
    font-size: 1.7rem;
  }

  .time-page .time-stage {
    flex-direction: column;
    gap: 1.6rem;
    margin-top: 2.4rem;
    margin-bottom: 0;
  }

  .time-page .cat-bed {
    width: 220px;
    height: 220px;
    margin-top: 0;
  }

  .time-page .slider-section {
    max-width: 100%;
    margin-top: 2.4rem;
  }
}

/* =========================================
   Chapter 1 – Page 04 final screen
   ========================================= */

   body.page04.body-clock-final-page {
    margin: 0;
    min-height: 100vh;
    display: block;
  
    background-image: url("c1p4.png");
    background-position: 58% 48%;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: scroll;
  
    color: #ffffff;
  }
  
  /* whole page layout */
  body.page04.body-clock-final-page .body-clock-final-layout {
    position: relative;
    min-height: 100vh;
    width: 100%;
    padding: 1.1rem 2rem 2rem;
  
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  /* ===============================
     Title capsule — smaller + higher
     =============================== */
  
  body.page04.body-clock-final-page .body-clock-final-header {
    position: relative;
    z-index: 5;
  
    margin-top: 0.15rem;
  
    padding: 0.72rem 3rem 0.86rem;
  
    border-radius: 999px;
    border: 1.6px solid rgba(255, 255, 255, 0.92);
  
    background: rgba(190, 150, 172, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  
    box-shadow:
      0 12px 28px rgba(0, 0, 0, 0.11),
      inset 0 0 18px rgba(255, 255, 255, 0.16);
  }
  
  body.page04.body-clock-final-page .body-clock-final-logo {
    margin: 0;
  
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    font-weight: 600;
  
    font-size: clamp(2.1rem, 3.7vw, 3.35rem);
    line-height: 1;
  
    color: #111111;
    text-shadow: none;
  }
  
  body.page04.body-clock-final-page .body-clock-final-status {
    margin: 0.38rem 0 0;
  
    font-size: 0.78rem;
    line-height: 1.25;
    font-weight: 700;
  
    color: #1f2831;
    opacity: 0.92;
  }
  
  /* ===============================
     Copy + button group on left side — moved higher
     =============================== */
  
  body.page04.body-clock-final-page .body-clock-final-copy-section {
    position: absolute;
    z-index: 5;
  
    /* left blank area */
    left: 6%;
    bottom: 55%;
  
    width: min(31vw, 430px);
    max-width: 430px;
  
    padding: 0.75rem 1rem;
    border-radius: 16px;
  
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
  }
  
  body.page04.body-clock-final-page .body-clock-final-copy {
    margin: 0;
  
    font-size: 0.88rem;
    line-height: 1.65;
  
    opacity: 0.95;
    color: #1f2831;
  }
  
  /* button under the copy box, also on left */
  body.page04.body-clock-final-page .body-clock-final-actions {
    position: absolute;
    z-index: 5;
  
    left: 6%;
    bottom: 46%;
  
    width: min(31vw, 430px);
    max-width: 430px;
  
    display: flex;
    justify-content: center;
  }
  
  body.page04.body-clock-final-page .body-clock-final-home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  
    min-width: 170px;
    padding: 0.7rem 1.55rem;
  
    border-radius: 999px;
    text-decoration: none;
  
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    font-size: 0.85rem;
  
    background: rgba(255, 255, 255, 0.92);
    color: #111111;
  
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  
    transition:
      transform 0.18s ease,
      background 0.18s ease;
  }
  
  body.page04.body-clock-final-page .body-clock-final-home-button:hover {
    background: #ffffff;
    transform: translateY(-1px);
  }
  
  /* ===============================
     Responsive fallback
     =============================== */
  
  @media (max-width: 900px) {
    body.page04.body-clock-final-page .body-clock-final-layout {
      padding: 1rem 1.2rem 1.5rem;
    }
  
    body.page04.body-clock-final-page .body-clock-final-header {
      margin-top: 0.4rem;
      padding: 0.72rem 2rem 0.85rem;
    }
  
    body.page04.body-clock-final-page .body-clock-final-logo {
      font-size: clamp(2rem, 8vw, 3rem);
    }
  
    body.page04.body-clock-final-page .body-clock-final-status {
      font-size: 0.75rem;
    }
  
    body.page04.body-clock-final-page .body-clock-final-copy-section,
    body.page04.body-clock-final-page .body-clock-final-actions {
      left: 50%;
      transform: translateX(-50%);
      width: min(82vw, 520px);
    }
  
    body.page04.body-clock-final-page .body-clock-final-copy-section {
      bottom: 24%;
    }
  
    body.page04.body-clock-final-page .body-clock-final-actions {
      bottom: 13%;
    }
  }
  
/* ================================
   Chapter 3 – Google-map-ish home route
   ================================ */

   body.chapter3-page {
    margin: 0;
    min-height: 100vh;
    display: block;
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1f2a44;
    background: #f5f5f5;
    overflow: hidden;
  }
  
  .chapter3-app {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
  }
  
  /* ---------- map background ---------- */
  
  .chapter3-map-wrap {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
  }
  
  .chapter3-map {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform-origin: center center;
    transition: transform 0.35s ease;
  }
  
  /* optional body class from fake search / slider */
  body.chapter3-page.map-zoomed .chapter3-map {
    transform: scale(1.12);
  }
  
  /* ---------- back button ---------- */
  
  .chapter3-back {
    position: absolute;
    top: 1.3rem;
    left: 1.3rem;
    z-index: 30;
  
    display: inline-flex;
    align-items: center;
    justify-content: center;
  
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    font-size: 0.88rem;
    line-height: 1;
    padding: 0.72rem 1.15rem;
    border-radius: 999px;
    text-decoration: none;
  
    background: rgba(255, 255, 255, 0.84);
    color: #1f2a44;
    border: 1px solid rgba(31, 42, 68, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
  }
  
  /* ---------- Google-map-ish top UI ---------- */
  
  .c3-map-top-ui {
    position: absolute;
    top: 1.15rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 25;
  
    width: min(82vw, 820px);
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    align-items: center;
    pointer-events: none;
  }
  
  .c3-search-bar {
    width: min(72vw, 520px);
    min-height: 46px;
    padding: 0 1rem;
  
    display: flex;
    align-items: center;
    gap: 0.65rem;
  
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: rgba(31, 42, 68, 0.75);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  
    pointer-events: auto;
  }
  
  .c3-search-icon {
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    font-size: 1.15rem;
    line-height: 1;
  }
  
  .c3-search-text {
    font-size: 0.96rem;
    line-height: 1;
  }
  
  .c3-chip-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    pointer-events: auto;
  }
  
  .c3-chip {
    border: 1px solid rgba(31, 42, 68, 0.1);
    border-radius: 999px;
    padding: 0.46rem 0.78rem;
  
    font-family: "DM Sans", system-ui, sans-serif;
    font-size: 0.82rem;
    line-height: 1;
    color: #1f2a44;
  
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.09);
    cursor: default;
  }
/* animated route line */
.c3-route-layer {
  position: absolute;
  inset: 0;
  z-index: 13;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* visible dashed route */
.c3-route-path {
  fill: none;
  stroke: rgba(252, 62, 128, 0.92);
  stroke-width: 0.55;
  stroke-linecap: round;
  stroke-linejoin: round;

  /* 真正的虚线在这里 */
  stroke-dasharray: 1.4 1.2;

  opacity: 0;
  filter:
    drop-shadow(0 2px 0 rgba(255, 255, 255, 0.8))
    drop-shadow(0 0 8px rgba(255, 255, 255, 0.75));
}

.c3-route-path.is-drawing {
  opacity: 1;
}

/* invisible reveal path inside mask */
.c3-route-mask-path {
  fill: none;
  stroke: white;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;

  stroke-dasharray: var(--route-length);
  stroke-dashoffset: var(--route-length);
}

.c3-route-mask-path.is-drawing {
  animation: c3RouteReveal 2.25s ease-out forwards;
}

@keyframes c3RouteReveal {
  from {
    stroke-dashoffset: var(--route-length);
  }

  to {
    stroke-dashoffset: 0;
  }
}

  /* ---------- markers ---------- */
  
  .c3-marker {
    position: absolute;
    z-index: 15;
  
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
  
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
  
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    color: #1f2a44;
  
    transform: translate(-50%, -100%);
    transition:
      transform 0.18s ease,
      filter 0.18s ease,
      opacity 0.18s ease;
  }
  
  .c3-marker:hover,
  .c3-marker:focus {
    transform: translate(-50%, -104%) scale(1.04);
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.18));
    outline: none;
  }
  
  .c3-marker.is-selected {
    transform: translate(-50%, -104%) scale(1.08);
    filter:
      drop-shadow(0 10px 18px rgba(0, 0, 0, 0.18))
      drop-shadow(0 0 12px rgba(255, 255, 255, 0.55));
  }
  
  .c3-marker-pin {
    position: relative;
    width: 52px;
    height: 52px;
  
    display: flex;
    align-items: center;
    justify-content: center;
  
    border-radius: 50% 50% 50% 8px;
    transform: rotate(-45deg);
  
    box-shadow:
      0 8px 18px rgba(0, 0, 0, 0.16),
      inset 0 0 0 2px rgba(255, 255, 255, 0.75);
  }
  
  .c3-marker-icon {
    display: inline-block;
    transform: rotate(45deg);
    font-size: 1.35rem;
    line-height: 1;
  }
  
  .c3-marker-label {
    padding: 0.32rem 0.62rem;
    border-radius: 999px;
  
    background: rgba(255, 255, 255, 0.86);
    color: #1f2a44;
  
    font-size: 0.85rem;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  /* clickable markers gently float */
.c3-marker-mouse,
.c3-marker-fish {
  animation: c3MarkerFloat 3.2s ease-in-out infinite;
}

.c3-marker-fish {
  animation-delay: 0.45s;
}

@keyframes c3MarkerFloat {
  0%, 100% {
    transform: translate(-50%, -100%) translateY(0);
  }

  50% {
    transform: translate(-50%, -100%) translateY(-5px);
  }
}
  /* marker colors + positions: adjust top/left to match your map */
  .c3-marker-mouse {
    top: 46%;
    left: 36%;
  }
  
  .c3-marker-mouse .c3-marker-pin {
    background: #ff8fbc;
  }
  
  .c3-marker-fish {
    position: absolute;
    left: 71%;
    top: 66%;
  }
  
  .c3-marker-fish .c3-marker-pin {
    background: #8ed9ff;
  }
  
  /* ---------- location card ---------- */
  
  .c3-location-card {
    position: absolute;
    right: 2rem;
    top: 8.4rem;
    z-index: 24;
  
    width: min(88vw, 360px);
    padding: 1.05rem 1.1rem 1rem;
  
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.9);
    color: #1f2a44;
  
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    pointer-events: none;
  
    transition:
      opacity 0.2s ease,
      transform 0.2s ease;
  }
  
  .c3-location-card.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
  
  .c3-location-card.hidden {
    display: block;
  }
  
  .c3-card-kicker {
    margin: 0 0 0.45rem;
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    font-size: 0.84rem;
    line-height: 1.2;
    color: rgba(31, 42, 68, 0.62);
  }
  
  .c3-card-title {
    margin: 0 0 0.75rem;
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    font-size: 1.85rem;
    line-height: 1;
    color: #1f2a44;
  }
  
  .c3-card-rules {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  
    margin: 0 0 0.85rem;
    padding: 0.75rem 0.8rem;
  
    border-radius: 14px;
    background: rgba(142, 217, 255, 0.16);
  }
  
  .c3-card-rules p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.35;
  }
  
  .c3-rule-label {
    font-weight: 700;
  }
  
  .c3-card-body {
    margin: 0 0 0.95rem;
    font-size: 0.96rem;
    line-height: 1.55;
  }
  
  .c3-go-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  
    min-width: 86px;
    padding: 0.65rem 1.1rem;
    border: none;
    border-radius: 999px;
  
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    font-size: 0.95rem;
    line-height: 1;
  
    background: #1f2a44;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(31, 42, 68, 0.18);
    cursor: pointer;
  
    transition:
      transform 0.16s ease,
      background 0.16s ease;
  }
  
  .c3-go-button:hover {
    transform: translateY(-1px);
    background: #2c3a5c;
  }
  
  .c3-route-message {
    margin: 0.85rem 0 0;
    padding: 0.65rem 0.8rem;
  
    border-radius: 14px;
    background: rgba(255, 143, 188, 0.18);
    color: #1f2a44;
  
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    font-size: 0.92rem;
    line-height: 1.35;
  }
  
  .c3-route-message.hidden {
    display: none;
  }
  
  .c3-route-message.is-visible {
    display: block;
  }

  /* close button for location card */
.c3-card-close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  z-index: 3;

  width: 28px;
  height: 28px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 999px;

  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1.2rem;
  line-height: 1;
  font-weight: 700;

  color: rgba(31, 42, 68, 0.72);
  background: rgba(255, 255, 255, 0.64);

  cursor: pointer;
  transition:
    background 0.16s ease,
    transform 0.16s ease,
    color 0.16s ease;
}

.c3-card-close:hover {
  background: rgba(255, 255, 255, 0.92);
  color: #1f2a44;
  transform: scale(1.05);
}
  
  /* route unavailable = tiny system freakout */
  body.chapter3-page.route-unavailable .c3-location-card {
    box-shadow:
      0 18px 46px rgba(0, 0, 0, 0.18),
      0 0 0 2px rgba(255, 143, 188, 0.22);
  }
  
  /* decorative mouse image near mouse marker */
.c3-deco-mouse {
  position: absolute;
  left: 11%;
  top: 20%;
  z-index: 12;

  width: min(40vw, 480px);
  height: auto;

  pointer-events: none;
  user-select: none;

  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.16));
  transform: rotate(-6deg);
}

/* decorative fish image near fish marker */
.c3-deco-fish {
  position: absolute;
  left: 61%;
  top: 51%;
  z-index: 12;

  width: min(40vw, 500px);
  height: auto;

  pointer-events: none;
  user-select: none;

  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.16));
  transform: rotate(8deg);
}

  /* ---------- optional zoom slider ---------- */
  /* If you add mapZoomSlider back into HTML, this is ready. */
  
  .chapter3-zoom-ui {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
  }
  
  .zoom-panel {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: #1f2a44;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  }
  
  .zoom-symbol {
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    font-size: 1.2rem;
    line-height: 1;
    user-select: none;
  }
  
  .chapter3-slider {
    width: 190px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
  }
  
  .chapter3-slider::-webkit-slider-runnable-track {
    height: 2px;
    border-radius: 999px;
    background: rgba(31, 42, 68, 0.8);
  }
  
  .chapter3-slider::-moz-range-track {
    height: 2px;
    border-radius: 999px;
    background: rgba(31, 42, 68, 0.8);
  }
  
  .chapter3-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #1f2a44;
    margin-top: -8px;
    cursor: pointer;
  }
  
  .chapter3-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #1f2a44;
    cursor: pointer;
  }
  
  /* ---------- final action ---------- */
  
  .chapter3-actions {
    position: absolute;
    right: 2rem;
    bottom: 1.5rem;
    z-index: 25;
  }
  
  .chapter3-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  
    min-width: 150px;
    padding: 0.75rem 1.2rem;
    border-radius: 999px;
    text-decoration: none;
  
    font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
    font-size: 0.95rem;
    line-height: 1;
  
    background: rgba(31, 42, 68, 0.92);
    color: #ffffff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  
    transition:
      transform 0.18s ease,
      background 0.18s ease;
  }
  
  .chapter3-next:hover {
    transform: translateY(-1px);
    background: #1f2a44;
  }
  
  /* ---------- responsive ---------- */
  
  @media (max-width: 768px) {
    .chapter3-back {
      top: 1rem;
      left: 1rem;
      font-size: 0.78rem;
      padding: 0.62rem 0.95rem;
    }
  
    .c3-map-top-ui {
      top: 4.2rem;
      width: min(92vw, 520px);
    }
  
    .c3-search-bar {
      width: 100%;
      min-height: 42px;
    }
  
    .c3-chip-row {
      gap: 0.35rem;
    }
  
    .c3-chip {
      font-size: 0.75rem;
      padding: 0.4rem 0.62rem;
    }
  
    .c3-marker-pin {
      width: 44px;
      height: 44px;
    }
  
    .c3-marker-icon {
      font-size: 1.1rem;
    }
  
    .c3-marker-label {
      font-size: 0.76rem;
    }
  
    .c3-marker-mouse {
      top: 44%;
      left: 28%;
    }
  
    .c3-marker-fish {
      top: 61%;
      left: 54%;
    }
  
    .c3-location-card {
      right: 1rem;
      top: auto;
      bottom: 5.4rem;
      width: calc(100vw - 2rem);
      max-width: none;
      padding: 0.95rem 1rem;
    }
  
    .c3-card-title {
      font-size: 1.55rem;
    }
  
    .c3-card-rules p,
    .c3-card-body {
      font-size: 0.88rem;
    }
  
    .chapter3-actions {
      right: 1rem;
      bottom: 1rem;
    }
  
    .chapter3-next {
      min-width: 130px;
      padding: 0.7rem 1rem;
      font-size: 0.86rem;
    }
  
    .chapter3-zoom-ui {
      left: 1rem;
      bottom: 1rem;
      transform: none;
    }
  
    .zoom-panel {
      gap: 0.7rem;
      padding: 0.65rem 0.85rem;
    }
  
    .chapter3-slider {
      width: 130px;
    }
  }

  /* ================================
   Chapter 3 – intro popup + title fix
   Add this at the END of Chapter 3 CSS
   ================================ */

/* make the chapter layout stay full-screen */
body.chapter3-page {
  overflow: hidden;
}

body.chapter3-page .chapter3-app {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

/* title should float over the map, not push the map down */
body.chapter3-page .chapter3-header {
  position: absolute;
  top: 1.45rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 22;

  width: min(86vw, 720px);
  text-align: center;
  pointer-events: none;
}

body.chapter3-page .chapter3-title {
  margin: 0;
  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1;
  color: #1f2a44;
  letter-spacing: 0.03em;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.7),
    0 0 18px rgba(255, 255, 255, 0.55);
}

body.chapter3-page .chapter3-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  line-height: 1.35;
  color: rgba(31, 42, 68, 0.82);
}

body.chapter3-page .chapter3-instruction {
  display: inline-block;
  margin: 0.65rem auto 0;
  max-width: 520px;
  padding: 0.7rem 1rem;

  font-size: 0.95rem;
  line-height: 1.55;
  color: #1f2a44;

  background: rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* intro popup overlay */
body.chapter3-page .c3-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 2rem;
  background: rgba(255, 244, 250, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  opacity: 1;
  pointer-events: auto;
  transition:
    opacity 0.24s ease,
    visibility 0.24s ease;
}

body.chapter3-page .c3-intro-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* loading */
.c3-route-loading {
  position: absolute;
  left: 50%;
  top: 64%;
  transform: translate(-50%, -50%);
  z-index: 30;

  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);

  font-family: "Pixelify Sans", "DM Sans", sans-serif;
  font-size: 1.25rem;
  color: #ff4fa3;
  letter-spacing: 0.02em;
}

.c3-route-loading.hidden {
  display: none;
}

/* intro card, matching your intro2 vibe */
body.chapter3-page .c3-intro-card {
  width: min(88vw, 720px);
  padding: 2rem 2.25rem;

  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  color: #1f2a44;

  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.18);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.chapter3-page .c3-intro-title {
  margin: 0 0 1.25rem;
  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.7rem);
  line-height: 1.22;
  letter-spacing: 0.02em;
  color: #1f2a44;
}

body.chapter3-page .c3-intro-text {
  margin: 0 0 1rem;
  max-width: 620px;

  font-size: 1rem;
  line-height: 1.75;
  color: #1f2a44;
}

body.chapter3-page .c3-intro-button {
  margin-top: 0.85rem;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 92px;
  padding: 0.75rem 1.35rem;

  border: none;
  border-radius: 999px;

  font-family: "Pixelify Sans", "DM Sans", system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1;

  background: #1f2a44;
  color: #ffffff;

  box-shadow: 0 10px 26px rgba(31, 42, 68, 0.18);
  cursor: pointer;

  transition:
    transform 0.16s ease,
    background 0.16s ease;
}

body.chapter3-page .c3-intro-button:hover {
  transform: translateY(-1px);
  background: #2c3a5c;
}

/* make sure the map still fills the whole screen */
body.chapter3-page .chapter3-map-wrap {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

body.chapter3-page .chapter3-map {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* if old search styles are still around, hide unused fake search */
body.chapter3-page .fake-search,
body.chapter3-page .c3-map-top-ui,
body.chapter3-page .c3-search-bar,
body.chapter3-page .c3-chip-row {
  display: none;
}

/* mobile */
@media (max-width: 768px) {
  body.chapter3-page .chapter3-header {
    top: 1rem;
    width: min(92vw, 520px);
  }

  body.chapter3-page .chapter3-title {
    font-size: 2.3rem;
  }

  body.chapter3-page .chapter3-instruction {
    font-size: 0.86rem;
    padding: 0.6rem 0.85rem;
  }

  body.chapter3-page .c3-intro-card {
    padding: 1.5rem 1.35rem;
  }

  body.chapter3-page .c3-intro-title {
    font-size: 1.55rem;
  }

  body.chapter3-page .c3-intro-text {
    font-size: 0.92rem;
    line-height: 1.65;
  }
}

/* center popup image after route result */
.c3-love-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 9997;

  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0;
  pointer-events: none;

  transition:
    opacity 0.22s ease,
    transform 0.22s ease;
}

.c3-love-popup.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.c3-love-popup.hidden {
  display: none;
}

.c3-love-popup img {
  width: min(42vw, 420px);
  height: auto;
  display: block;

  filter:
    drop-shadow(0 18px 36px rgba(0, 0, 0, 0.18))
    drop-shadow(0 0 22px rgba(255, 255, 255, 0.78));
}
