:root {
  --pond-blue: #8faeb5;
  --mist-blue: #c8d9d8;
  --lily-green: #718b75;
  --sage-light: #b8c6ad;
  --lilac: #aaa1bd;
  --petal-pink: #cda7ac;
  --paper: #f2ecdc;
  --ink: #1f3233;
  --warm-light: #e4c995;
  --primary: var(--petal-pink);
  --accent: var(--lily-green);
  --bg: var(--mist-blue);
  --text: var(--ink);
  --content-max: 1120px;
  --letter-max: 38rem;
  --page-pad: clamp(20px, 5vw, 80px);
  --shadow-soft: 0 22px 50px rgba(31, 50, 51, 0.18);
  --shadow-small: 0 12px 28px rgba(31, 50, 51, 0.14);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", Arial, sans-serif;
  background: var(--mist-blue);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: -3;
  background-image: url("../img/monet-garden-mobile.webp");
  background-size: cover;
  background-position: center;
  animation: gardenDrift 24s ease-in-out infinite alternate;
  filter: blur(0.5px) contrast(1.05) saturate(0.95);
}

body::after {
  z-index: -2;
  background:
    linear-gradient(115deg, rgba(228, 201, 149, 0.28), rgba(242, 236, 220, 0.18) 38%, rgba(143, 174, 181, 0.22)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(0deg, rgba(55, 70, 71, 0.018) 0 1px, transparent 1px 6px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  animation: lightShift 40s ease-in-out infinite alternate;
}

@keyframes gardenDrift {
  from { transform: scale(1.02) translate3d(-0.5%, -0.4%, 0); }
  to { transform: scale(1.07) translate3d(0.7%, 0.5%, 0); }
}

@keyframes lightShift {
  from { background-position: 0% 0%, 0 0, 0 0, 0 0; }
  to { background-position: 120% 80%, 0 0, 0 0, 0 0; }
}

.song {
  display: none;
}

#theme-toggle {
  display: none;
}

.container {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  text-align: center;
  visibility: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.section {
  position: absolute;
  inset: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vw, 34px);
  padding: max(20px, var(--page-pad));
  overflow-y: auto;
  overflow-x: hidden;
  pointer-events: none;
  visibility: hidden;
}

.section > * {
  max-width: min(var(--letter-max), 100%);
}

.start-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(1.5rem + env(safe-area-inset-top)) 1.5rem calc(1.5rem + env(safe-area-inset-bottom));
  background:
    linear-gradient(rgba(242, 236, 220, 0.48), rgba(200, 217, 216, 0.34)),
    url("../img/monet-garden-mobile.webp") center / cover;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.start-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-btn,
.replay-btn {
  font-family: "Songti SC", "STSong", "SimSun", serif;
}

.start-btn {
  min-width: 7.5rem;
  min-height: 3.1rem;
  padding: 0.72rem 2rem;
  border: 1px solid rgba(113, 139, 117, 0.35);
  border-radius: 999px;
  background: rgba(242, 236, 220, 0.94);
  color: var(--ink);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: var(--shadow-small);
}

.start-btn:disabled {
  opacity: 0.75;
  cursor: default;
}

.greeting-title,
.section-announcement p,
.quote-text,
.wish-hbd,
.closing-text {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  color: var(--ink);
  text-shadow: 1px 2px 3px rgba(0, 0, 0, 0.08), 0 1px 0 rgba(242, 236, 220, 0.4);
}

.greeting-title {
  font-size: clamp(2.2rem, 5vw, 5rem);
  font-weight: 700;
  line-height: 1.18;
  max-width: min(12em, 100%);
  overflow-wrap: break-word;
}

.greeting-name {
  display: block;
  color: var(--ink);
}

.greeting-subtitle {
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  line-height: 1.9;
  font-weight: 500;
  color: rgba(31, 50, 51, 0.88);
  max-width: min(34em, 100%);
}

.section-announcement p {
  font-size: clamp(1.8rem, 4vw, 4rem);
  font-weight: 700;
  line-height: 1.35;
  max-width: min(11em, 100%);
}

.section-countdown {
  gap: 0;
}

.countdown-wrapper {
  position: relative;
  width: min(320px, 80vw);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 236, 220, 0.58), rgba(143, 174, 181, 0.2) 58%, transparent 68%);
}

.countdown-num,
.countdown-go {
  position: absolute;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  color: var(--ink);
  opacity: 0;
}

.countdown-num {
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 500;
}

.countdown-go {
  font-size: clamp(3.4rem, 9vw, 6rem);
}

.text-box,
.quote-card {
  width: min(var(--letter-max), 100%);
  padding: clamp(24px, 5vw, 54px);
  border: none;
  border-radius: 12px;
  background: rgba(255, 252, 244, 0.88);
  box-shadow: 0 6px 30px rgba(31, 50, 51, 0.1), inset 0 0 60px rgba(242, 236, 220, 0.4);
  position: relative;
  overflow: hidden;
}

.text-box::before,
.quote-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paper)' opacity='0.05'/%3E%3C/svg%3E");
  opacity: 0.8;
  pointer-events: none;
  mix-blend-mode: overlay;
  border-radius: inherit;
}

.section-chatbox {
  overflow: visible;
}

.chatbox-hint {
  color: var(--ink);
  opacity: 0;
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  margin-top: 0.6rem;
  transform: translateY(8px);
}

.text-box {
  position: relative;
  text-align: center;
}

.hbd-chatbox {
  min-height: 5.7em;
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  line-height: 1.9;
  font-weight: 500;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.fake-btn {
  appearance: none;
  border: 1px solid rgba(113, 139, 117, 0.28);
  background: rgba(184, 198, 173, 0.88);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 1.2rem;
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: clamp(0.85rem, 1vw, 1rem);
  cursor: pointer;
  white-space: nowrap;
  min-width: 56px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: var(--shadow-small);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.fake-btn.is-ready {
  pointer-events: auto;
}

.section-ideas .idea-line {
  position: absolute;
  left: 50%;
  right: auto;
  width: min(var(--letter-max), calc(100vw - 40px));
  padding: clamp(22px, 4vw, 48px);
  transform: translateX(-50%);
  border: 1px solid rgba(113, 139, 117, 0.2);
  border-radius: 4px;
  background: rgba(242, 236, 220, 0.9);
  box-shadow: var(--shadow-small);
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(1.35rem, 2.4vw, 2.35rem);
  line-height: 1.65;
  font-weight: 500;
  color: var(--ink);
  opacity: 0;
}

.idea-line strong,
.idea-special span {
  display: inline;
  padding: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  font-weight: inherit;
}

.idea-special {
  font-size: clamp(1.45rem, 2.7vw, 2.55rem) !important;
  font-weight: 600 !important;
}

.idea-big-letters {
  display: none;
}

.quote-card {
  text-align: center;
}

.quote-mark {
  display: block;
  margin-bottom: 0.35rem;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1;
  color: rgba(113, 139, 117, 0.56);
}

.quote-text {
  font-size: clamp(1.4rem, 2.4vw, 2.6rem);
  line-height: 1.7;
  font-style: normal;
  font-weight: 600;
}

.quote-author {
  margin-top: 1rem;
  color: rgba(31, 50, 51, 0.74);
  font-size: clamp(0.9rem, 1vw, 1rem);
}

.section-stars,
.section-balloons,
.section-fireworks,
.section-confetti {
  position: fixed !important;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.section-stars {
  z-index: 0;
}

.star {
  position: absolute;
  width: 24px;
  height: 24px;
  animation: waterGlimmer var(--duration, 4s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}

@keyframes waterGlimmer {
  from { opacity: 0.12; transform: scale(0.85); }
  to { opacity: 0.42; transform: scale(1.08); }
}

.section-balloons {
  z-index: 1;
}

.balloon-item {
  will-change: transform, opacity;
}

.section-fireworks {
  z-index: 2;
}

.firework-spark {
  position: absolute;
  width: 20px;
  height: 20px;
}

.section-confetti {
  z-index: 3;
}

.confetti-dot {
  position: absolute;
  width: 24px;
  height: 24px;
  visibility: hidden;
  opacity: 0.2;
}

.section-profile,
.section-closing {
  z-index: 5;
}

.section-profile {
  justify-content: center;
}

.profile-wrapper {
  position: relative;
  display: inline-block;
  width: auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.profile-picture {
  width: clamp(170px, 34vw, 300px);
  height: clamp(170px, 34vw, 300px);
  object-fit: cover;
  border-radius: 50%;
  display: block;
  border: 4px solid rgba(242, 236, 220, 0.72);
  box-shadow: var(--shadow-soft);
}

.hat {
  position: absolute;
  width: clamp(74px, 13vw, 104px);
  top: clamp(-154px, -20vw, -110px);
  left: 50%;
  transform: translateX(-50%);
  transform-origin: 50% 92%;
  pointer-events: none;
}

.profile-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(3rem, 9vw, 6rem);
  background: var(--mist-blue);
}

.wish {
  width: min(var(--letter-max), 100%);
  max-width: min(var(--letter-max), 100%);
  padding: clamp(8px, 2vw, 18px) 0;
}

.wish-hbd {
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 700;
  text-transform: none;
  color: #9b5964;
}

.wish-hbd span {
  display: inline-block;
}

.wish-text {
  margin: 1rem auto 0;
  max-width: min(34em, 100%);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  line-height: 1.9;
  font-weight: 500;
  color: rgba(31, 50, 51, 0.86);
  overflow-wrap: anywhere;
}

.section-closing p {
  max-width: min(34em, 100%);
  font-size: clamp(1.2rem, 2.4vw, 2.2rem);
  font-weight: 600;
  line-height: 1.9;
  color: var(--ink);
}

.replay-btn {
  cursor: pointer;
  z-index: 6;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 0.4rem;
  padding: 0.58rem 1.25rem;
  border: 1px solid rgba(113, 139, 117, 0.3);
  border-radius: 999px;
  background: rgba(242, 236, 220, 0.86);
  color: var(--ink) !important;
  font-size: clamp(0.95rem, 1vw, 1.05rem) !important;
  font-weight: 600 !important;
  box-shadow: var(--shadow-small);
}

.replay-btn:hover {
  opacity: 0.78;
}

.last-smile {
  display: none;
}

@media (min-width: 768px) {
  body::before {
    background-image: url("../img/monet-garden-desktop.webp");
    background-position: center;
  }

  .start-overlay {
    background:
      linear-gradient(rgba(242, 236, 220, 0.42), rgba(200, 217, 216, 0.28)),
      url("../img/monet-garden-desktop.webp") center / cover;
  }

  .section {
    align-items: center;
    padding-left: max(32px, var(--page-pad));
    padding-right: max(32px, var(--page-pad));
  }

  .section > * {
    max-width: min(var(--content-max), 100%);
  }

  .section-greeting,
  .section-announcement,
  .section-quote,
  .section-closing {
    text-align: center;
    align-items: center;
    padding-left: max(32px, var(--page-pad));
  }

  .text-box,
  .quote-card {
    width: min(560px, 48vw);
  }

  .section-chatbox {
    align-items: center;
    padding-left: max(32px, var(--page-pad));
  }

  .section-ideas .idea-line {
    left: 50%;
    transform: translateX(-50%);
    width: min(560px, 48vw);
  }

  .section-profile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  .profile-wrapper {
    justify-self: center;
  }

  .wish {
    align-self: center;
    justify-self: center;
  }

  .wish-text {
    margin-left: auto;
  }
}

@media (max-width: 600px) {
  .text-box {
    width: 100%;
  }

  .hbd-chatbox {
    min-height: 7.4em;
  }

  .fake-btn {
    right: 12px;
    bottom: 10px;
    min-width: 52px;
    height: 32px;
    padding: 0.3rem 1rem;
  }

  .wish-hbd {
    font-size: clamp(1.9rem, 9vw, 3rem);
  }

  .wish-text {
    font-size: clamp(1.05rem, 4vw, 1.3rem);
  }
}

@media (max-height: 740px) {
  .section {
    justify-content: flex-start;
  }

  .profile-wrapper {
    width: auto;
  }

  .wish-hbd {
    font-size: clamp(1.7rem, 7vw, 2.6rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  body::before {
    animation: none;
  }
}
