@font-face {
  font-family: "KuaiLe";
  src: url("../fonts/zcool-kuaile-chinese-simplified-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+3000-303F, U+3400-4DBF, U+4E00-9FFF, U+FF00-FFEF;
}

@font-face {
  font-family: "KuaiLe";
  src: url("../fonts/zcool-kuaile-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4efe6;
  --ink: #3a3128;
  --soft: #8d7d70;
  --card: #fffdf9;
  --pink: #ffd5df;
  --mint: #d7f3e3;
  --sky: #d5ebff;
  --butter: #fff0be;
  --shadow: 0 14px 34px rgba(92, 62, 32, 0.08);
  --radius: 28px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  scroll-padding-bottom: 96px;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: "Nunito", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", sans-serif;
  background:
    radial-gradient(820px 380px at 0% -8%, #ffe4ec 0%, transparent 62%),
    radial-gradient(760px 420px at 100% 0%, #e4f7ea 0%, transparent 58%),
    radial-gradient(680px 460px at 50% 110%, #e5f1ff 0%, transparent 52%),
    var(--bg);
}

img { max-width: 100%; }

button, input, textarea {
  font: inherit;
  color: inherit;
}

button:focus-visible, a:focus-visible {
  outline: 3px solid #f2b6c4;
  outline-offset: 3px;
}

h1, h2, h3, .brand span, .welcome, .spin, .solid, .tabbar a, .topnav a {
  font-family: "KuaiLe", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 400;
}

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(244, 239, 230, 0.88);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 20px;
}

.brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.topnav { display: none; gap: 6px; }

.topnav a, .tabbar a {
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 14px;
}

.topnav a.on, .tabbar a.on {
  background: #fff;
  box-shadow: 0 6px 16px rgba(90, 60, 30, 0.08);
}

main {
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.hero, .block {
  width: min(1040px, calc(100% - 28px));
  margin: 8px auto 28px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 0 8px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #c47b8a;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: 46px;
  line-height: 1.1;
}

.welcome {
  margin: 10px 0 0;
  font-size: 22px;
}

.subtitle, .section-head p, .card-tip, .foot {
  color: var(--soft);
}

.subtitle { margin: 8px 0 0; }

.hero-dog, .poke {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.hero-dog img, .poke img {
  width: min(78vw, 320px);
  filter: drop-shadow(0 18px 16px rgba(70, 42, 24, 0.12));
}

.hero-dog.boop img { animation: boop 0.45s ease; }

.say {
  position: absolute;
  left: 58%;
  top: 8%;
  max-width: 150px;
  padding: 8px 12px;
  border-radius: 16px 16px 16px 6px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 14px;
  line-height: 1.4;
}

.section-head { margin: 18px 4px 14px; }

.section-head h2 { margin: 0; font-size: 32px; }

.section-head p { margin: 6px 0 0; }

.wheel-box {
  position: relative;
  width: min(86vw, 380px);
  margin: 8px auto 0;
  aspect-ratio: 1;
}

.wheel-box canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 16px 30px rgba(90, 55, 30, 0.12), inset 0 0 0 8px #fff;
}

.pointer {
  position: absolute;
  z-index: 2;
  top: -4px;
  left: 50%;
  width: 28px;
  height: 34px;
  transform: translateX(-50%);
  background: #3a3128;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  filter: drop-shadow(0 3px 0 #fff);
}

.spin {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  transform: translate(-50%, -50%);
  border: 6px solid #fff;
  border-radius: 50%;
  background: #3a3128;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(40, 28, 18, 0.18);
}

.spin:disabled { opacity: 0.7; cursor: wait; }

.play-grid, .album, .notes {
  display: grid;
  gap: 12px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.poke-card { text-align: center; }

.poke img { width: min(70vw, 240px); }

.poke.hit img { animation: squash 0.48s ease; }

.card-kicker {
  margin: 0;
  color: #c47b8a;
  font-size: 13px;
  font-weight: 800;
}

.quote-card blockquote {
  margin: 14px 0 18px;
  font-family: "KuaiLe", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 24px;
  line-height: 1.45;
}

.plant {
  position: relative;
  height: 220px;
  margin: 8px 0 12px;
  overflow: hidden;
}

.plant img {
  position: absolute;
  left: 50%;
  bottom: 42px;
  width: 150px;
  transform: translateX(-50%) scale(var(--grow, 0.62));
  transform-origin: center bottom;
  transition: transform 0.45s cubic-bezier(0.2, 1.2, 0.4, 1);
}

.pot {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 92px;
  height: 54px;
  transform: translateX(-50%);
  border-radius: 0 0 18px 18px;
  background: linear-gradient(#f2b38a, #e59872);
  box-shadow: inset 0 8px 0 #f7c7a8;
}

.pot::before {
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  top: -10px;
  height: 16px;
  border-radius: 10px;
  background: #f6c9ad;
}

.drops span {
  position: absolute;
  top: 10px;
  width: 8px;
  height: 12px;
  border-radius: 8px;
  background: #8ec8ee;
  animation: drop 0.7s ease forwards;
}

.album { grid-template-columns: 1fr 1fr; }

.album figure {
  margin: 0;
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

.album img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background:
    linear-gradient(180deg, #fff, #fff8f2);
  padding: 8px;
}

.album figure.cover img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  padding: 0;
}

.album figcaption {
  padding: 0 12px 12px;
  font-size: 14px;
}

.wish-form { display: grid; gap: 12px; }

.wish-form label, .field-label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 800;
}

input, textarea, select {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 12px 14px;
  background: #f6f1ea;
  outline: none;
}

textarea { resize: vertical; }

.dots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.dots button {
  width: 34px;
  height: 34px;
  border: 3px solid transparent;
  border-radius: 50%;
  cursor: pointer;
}

.dots button.on { border-color: #3a3128; }

.dots .style-btn {
  width: auto;
  height: auto;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #eadfd4;
}

.dots .style-btn.on {
  border-color: #3a3128;
  background: #fff6ea;
}

.solid, .ghost {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
}

.solid { background: #3a3128; color: #fff; }

.ghost { background: #fff3e4; }

.form-msg { min-height: 1.2em; margin: 0; color: #c47b8a; }

.notes { grid-template-columns: 1fr 1fr; margin-top: 14px; }

.note {
  position: relative;
  min-height: 132px;
  padding: 22px 14px 12px;
  border-radius: 6px 18px 16px 18px;
  transform: rotate(var(--r, -2deg));
  box-shadow: 0 10px 18px rgba(80, 50, 30, 0.08);
}

.note.sticky::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 46px;
  height: 14px;
  transform: translateX(-50%) rotate(-3deg);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.72);
}

.note.bubble {
  border-radius: 22px;
}

.note.bubble::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: -6px;
  width: 14px;
  height: 14px;
  background: inherit;
  transform: rotate(45deg);
  border-radius: 0 0 3px 0;
}

.note strong { display: block; margin-bottom: 6px; }

.note p { margin: 0; line-height: 1.45; word-break: break-word; }

.note time {
  display: block;
  margin-top: 10px;
  color: rgba(58, 49, 40, 0.55);
  font-size: 12px;
}

.empty {
  grid-column: 1 / -1;
  color: var(--soft);
  text-align: center;
}

.foot { text-align: center; padding: 8px 0 20px; }

.foot a { color: var(--soft); }

.tabbar {
  position: fixed;
  z-index: 30;
  left: 12px;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.94);
  box-shadow: 0 10px 30px rgba(70, 45, 20, 0.12);
  backdrop-filter: blur(10px);
}

.tabbar a { flex: 1; text-align: center; font-size: 14px; }

.modal, .lightbox {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(58, 49, 40, 0.28);
}

.modal[hidden], .lightbox[hidden], .say[hidden] { display: none; }

.modal-card {
  width: min(100%, 320px);
  padding: 18px 18px 20px;
  border-radius: 32px;
  background: #fffdf9;
  text-align: center;
  box-shadow: var(--shadow);
  animation: pop 0.35s cubic-bezier(0.2, 1.3, 0.4, 1);
}

.modal-card img { width: 150px; }

.modal-card h3 { margin: 4px 0 16px; font-size: 30px; }

.lightbox { background: rgba(42, 34, 28, 0.72); }

.lightbox img {
  max-width: min(92vw, 860px);
  max-height: 76dvh;
  border-radius: 18px;
  background: #fff;
}

.lightbox p { color: #fff; text-align: center; }

.light-x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  font-size: 26px;
  cursor: pointer;
}

.bgm-dock {
  position: fixed;
  z-index: 35;
  left: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom));
}

.bgm-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(72vw, 260px);
  padding: 10px 14px 10px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 10px 26px rgba(70, 45, 20, 0.14);
  backdrop-filter: blur(10px);
  cursor: pointer;
  font-family: "KuaiLe", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 400;
  color: var(--ink);
}

.bgm-btn[aria-pressed="false"] {
  background: rgba(255, 243, 228, 0.98);
}

.bgm-note {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffd5df, #fff0be);
  font-size: 18px;
  line-height: 1;
}

.bgm-btn.playing .bgm-note {
  animation: bgm-bob 1.2s ease-in-out infinite;
}

.bgm-label {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bgm-state {
  font-family: "Nunito", "PingFang SC", sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: #c47b8a;
  white-space: nowrap;
}

.bgm-dock audio {
  display: none;
}

.bgm-dock.waiting .bgm-state {
  color: #8d7d70;
}

@keyframes bgm-bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-2px) rotate(6deg); }
}

.heart {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 10px;
  height: 10px;
  border-radius: 2px 2px 2px 0;
  background: #ff8fa8;
  transform: rotate(-45deg);
  animation: float 0.8s ease forwards;
  animation-delay: var(--d, 0s);
  pointer-events: none;
}

@keyframes boop {
  0% { transform: scale(1); }
  40% { transform: scale(1.06) rotate(-4deg); }
  100% { transform: scale(1); }
}

@keyframes squash {
  0% { transform: scale(1); }
  35% { transform: scale(1.14, 0.84) rotate(-6deg); }
  70% { transform: scale(0.94, 1.08) rotate(4deg); }
  100% { transform: scale(1); }
}

@keyframes pop {
  from { transform: translateY(10px) scale(0.92); }
  to { transform: none; }
}

@keyframes float {
  to { transform: translate(var(--x, 20px), -70px) rotate(20deg); opacity: 0; }
}

@keyframes drop {
  to { transform: translateY(120px); opacity: 0; }
}

@media (min-width: 880px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  main { padding-bottom: 40px; }
  .bgm-dock { left: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); }

  .hero {
    min-height: calc(100dvh - 92px);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    text-align: left;
    align-items: center;
  }

  h1 { font-size: 68px; }
  .welcome { font-size: 28px; }
  .hero-dog img { width: min(42vw, 460px); }

  .play-grid { grid-template-columns: 1.05fr 0.95fr; }
  .poke-card { grid-row: span 2; display: grid; align-content: center; }
  .album { grid-template-columns: repeat(3, 1fr); }
  .notes { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-dog.boop img, .poke.hit img, .modal-card, .heart, .drops span, .bgm-btn.playing .bgm-note {
    animation: none;
  }
}
