:root {
  color-scheme: light;
  --paper: #fffaf0;
  --ink: #783c29;
  --secondary: #936d55;
  --gold: #e9ae35;
  --rose: #e66570;
  --soft-rose: #f5a0a2;
  --stage: min(86vw, 360px);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 280px;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  overflow-x: hidden;
  isolation: isolate;
}
button { font: inherit; cursor: pointer; touch-action: manipulation; }
.render-filters { position: absolute; pointer-events: none; }
button:focus-visible { outline: 3px solid var(--ink); outline-offset: 7px; }
::selection { background: #f6d783; color: var(--ink); }

#stardust, .morning-light {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -2;
}
.morning-light {
  z-index: -1;
  background: radial-gradient(ellipse at 3% 9%, #ffe6b15e 0, transparent 47%), radial-gradient(ellipse at 100% 90%, #ffddd75e 0, transparent 45%);
}
.page-header {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
}
.brand { display: block; width: 34px; height: 34px; border-radius: 10px; }
.motion-toggle {
  width: 44px;
  height: 44px;
  padding: 11px;
  border: 0;
  border-radius: 50%;
  background: #f5e8d4;
  color: var(--ink);
  transition: transform 180ms ease, background 180ms ease;
}
.motion-toggle svg { display: block; width: 100%; height: 100%; }
.motion-toggle:hover { background: #f0dfc5; }
.motion-toggle:active { transform: scale(.92); }
.play-icon { display: none !important; }
body.is-paused .pause-icon { display: none; }
body.is-paused .play-icon { display: block !important; }

.greeting {
  min-height: 100svh;
  width: 100%;
  padding: max(94px, calc(env(safe-area-inset-top) + 70px)) 20px max(36px, calc(env(safe-area-inset-bottom) + 22px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.message { position: relative; z-index: 2; }
h1 { margin: 0; font-weight: 800; }
.name {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(70px, 19.8vw, 96px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.065em;
  animation: hello 1s cubic-bezier(.2, .7, .2, 1) both;
}
.comma { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; font-size: .38em; margin-left: .02em; letter-spacing: -.4em; }
.wish {
  display: block;
  margin-top: 19px;
  font-size: clamp(23px, 6.35vw, 32px);
  line-height: 1.5;
  letter-spacing: .015em;
  white-space: nowrap;
  animation: hello 1s .14s cubic-bezier(.2, .7, .2, 1) both;
}
.exclamations { letter-spacing: -.15em; margin-right: .15em; }
.illustration {
  position: relative;
  width: var(--stage);
  height: var(--stage);
  flex: 0 0 var(--stage);
  margin-top: 23px;
  animation: hello 1.1s .23s cubic-bezier(.2, .7, .2, 1) both;
}
.sunshine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe9a766 0, #ffefc74d 35%, #fff4da22 55%, transparent 71%);
  animation: breathe 5s ease-in-out infinite;
}
.character-button {
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 45%;
  z-index: 2;
}
.character-button:active .sticker { transform: scale(.95) rotate(-3deg); }
.character-float { display: block; width: 100%; height: 100%; animation: float 3s ease-in-out infinite; }
.sticker { display: block; position: relative; width: 100%; height: 100%; transition: transform 200ms ease; filter: url(#sticker-transparency); }
.sticker img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; pointer-events: none; }
/* The original PNG stays intact. Two CSS crops let its red heart beat independently. */
.character-base { clip-path: polygon(0 0, 70% 0, 70% 49%, 100% 49%, 100% 100%, 0 100%); }
.original-heart { clip-path: inset(32% 7% 50% 70%); transform-origin: 80% 42%; animation: heartbeat 1.45s ease-in-out infinite; }
.character-shadow {
  position: absolute;
  bottom: 7%;
  left: 30%;
  width: 40%;
  height: 4.5%;
  border-radius: 50%;
  background: #be8d3521;
  filter: blur(6px);
  animation: shadow 3s ease-in-out infinite;
  z-index: 0;
}
.sparkles { position: absolute; inset: 0; pointer-events: none; }
.sparkle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  color: var(--gold);
  animation: twinkle var(--duration) var(--delay) ease-in-out infinite;
  opacity: .8;
}
.sparkle svg { display: block; width: 100%; height: 100%; }
.sparkle:nth-child(3n) { color: #c58c22; }
.sparkle:nth-child(5n) { color: #f0c453; }
.floating-heart { position: absolute; display: block; color: var(--rose); z-index: 3; pointer-events: none; animation: heart-float 3.2s ease-in-out infinite; }
.floating-heart svg { display: block; width: 100%; height: 100%; }
.heart-one { left: 12%; top: 31%; width: 23px; height: 23px; transform: rotate(-20deg); }
.heart-two { right: 6%; top: 53%; width: 17px; height: 17px; color: var(--soft-rose); animation-delay: -.9s; }
.heart-three { left: 26%; bottom: 14%; width: 12px; height: 12px; color: var(--soft-rose); animation-delay: -1.8s; }
.little-note { margin: 16px 0 0; color: var(--secondary); font-size: 14px; font-weight: 500; letter-spacing: .07em; animation: hello 1s .55s both; }
.little-note svg { display: inline-block; width: 20px; height: 20px; margin-left: 3px; vertical-align: -5px; color: #bc6872; }
#love-bursts { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 10; }
.love-particle { position: absolute; width: var(--size); height: var(--size); left: var(--left); top: var(--top); color: var(--rose); animation: send-love 1.5s cubic-bezier(.16, .5, .4, 1) forwards; }
.love-particle svg { width: 100%; height: 100%; display: block; }
.love-particle:nth-child(3n) { color: #d8a135; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.noscript-note { text-align: center; color: var(--secondary); }

@keyframes hello { from { opacity: 0; transform: translateY(19px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%, 100% { transform: translateY(5px) rotate(-1.6deg); } 50% { transform: translateY(-12px) rotate(1.6deg); } }
@keyframes heartbeat { 0%, 100% { transform: scale(.86); } 22% { transform: scale(1.18); } 38% { transform: scale(.98); } 53% { transform: scale(1.12); } 72% { transform: scale(.86); } }
@keyframes twinkle { 0%, 100% { opacity: .28; transform: scale(.65) rotate(-9deg); } 48% { opacity: 1; transform: scale(1.15) rotate(12deg); } }
@keyframes heart-float { 0%, 100% { transform: translateY(3px) rotate(-14deg) scale(.86); } 50% { transform: translateY(-12px) rotate(6deg) scale(1.12); } }
@keyframes shadow { 0%, 100% { opacity: .8; transform: scaleX(1.02); } 50% { opacity: .4; transform: scaleX(.83); } }
@keyframes breathe { 0%, 100% { opacity: .65; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes send-love { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); } 12% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(var(--scale)) rotate(var(--rotate)); } }

body.is-paused *, body.is-paused *::before, body.is-paused *::after { animation-play-state: paused !important; }
body.is-paused .message *, body.is-paused .illustration, body.is-paused .little-note { animation: none; }
body.is-paused .love-particle { animation: none; display: none; }

@media (min-width: 700px) {
  :root { --stage: min(43vh, 400px); }
  .page-header { top: 24px; left: 30px; right: 30px; }
  .name { font-size: clamp(90px, 9vw, 116px); }
  .wish { margin-top: 17px; font-size: 34px; }
  .illustration { margin-top: 22px; }
  .little-note { margin-top: 14px; font-size: 15px; }
}
@media (max-width: 350px) {
  .greeting { padding-inline: 12px; }
  .name { font-size: 66px; }
  .wish { font-size: 21px; }
  .little-note { font-size: 13px; letter-spacing: .02em; }
}
@media (max-height: 720px) and (max-width: 699px) {
  :root { --stage: min(79vw, 290px); }
  .greeting { padding-top: 80px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .name { font-size: clamp(62px, 18vw, 78px); }
  .wish { margin-top: 9px; }
  .illustration { margin-top: 12px; }
  .little-note { margin-top: 8px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  :root { --stage: 245px; }
  .greeting { min-height: 100svh; flex-direction: row; gap: 25px; padding: 70px 32px 25px; flex-wrap: wrap; align-content: center; }
  .name { font-size: 68px; }
  .wish { font-size: 23px; }
  .illustration { margin: 0; }
  .little-note { width: 100%; margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  body:not(.motion-enabled) *, body:not(.motion-enabled) *::before, body:not(.motion-enabled) *::after { animation: none !important; transition: none !important; }
}
