:root {
  color-scheme: light;
  --paper: #fff9ed;
  --cream: #fff3df;
  --ink: #563b37;
  --muted: #795f57;
  --coral: #cf746c;
  --coral-dark: #a94f4e;
  --peach: #f4b8a3;
  --line: #ae7264;
  --mint: #dae5d4;
  font-family:
    "Trebuchet MS", "Arial Rounded MT Bold", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 280px;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 21%, #f8e4d5 0 2px, transparent 2.5px) 0 0 /
      36px 36px,
    radial-gradient(circle at 81% 35%, #f7e3d5 0 1.5px, transparent 2px) 0 0 /
      45px 45px,
    var(--paper);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #634c91;
  outline-offset: 4px;
}
button:active {
  transform: translateY(2px);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 0;
  z-index: 20;
  padding: 12px 16px;
  color: var(--ink);
  background: white;
  border-radius: 10px;
  transform: translateY(calc(-100% - 12px));
}
.skip-link:focus {
  top: 12px;
  transform: none;
}

.page-shell {
  width: min(100%, 960px);
  margin-inline: auto;
  padding: 0 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 10px;
  min-height: 76px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.06em;
}
.brand-mark {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border-radius: 10px 10px 10px 4px;
  color: var(--paper);
  background: var(--coral);
  font-family: Arial, sans-serif;
  font-size: 27px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  transform: rotate(-9deg);
}
.brand-dot {
  color: var(--coral);
}
.intro {
  position: relative;
  text-align: center;
  padding-top: 14px;
}
.intro-kicker {
  margin: 0 0 9px;
  color: var(--coral-dark);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.13em;
}
h1 {
  margin: 0 auto;
  max-width: 700px;
  font-size: clamp(37px, 9.5vw, 68px);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1.17;
}
h1 span {
  color: var(--coral-dark);
}
.intro-subtitle {
  max-width: 34em;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}
.tiny-star {
  position: absolute;
  color: #e2a66c;
  user-select: none;
}
.star-one {
  top: 46px;
  left: max(3%, calc(50% - 270px));
  font-size: 30px;
  transform: rotate(-17deg);
}
.star-two {
  top: 82px;
  right: max(4%, calc(50% - 265px));
  font-size: 20px;
  transform: rotate(18deg);
}

.room-wrap {
  position: relative;
  max-width: 680px;
  margin: 27px auto 0;
  filter: drop-shadow(0 15px 0 rgba(148, 89, 71, 0.09));
}
.room {
  position: relative;
  width: 100%;
  aspect-ratio: 680 / 552;
  isolation: isolate;
}
.room-art {
  display: block;
  width: 100%;
  height: 100%;
}
.scene-button {
  position: absolute;
  display: block;
  z-index: 2;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  transform-origin: center bottom;
}
.scene-button svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 3px 1px rgba(102, 61, 51, 0.12));
}
.scene-button:active {
  transform: translateY(1px) scale(0.98);
}
.scene-button:focus-visible {
  outline-offset: 5px;
  border-radius: 10px;
}
.album-frame {
  left: 75.8%;
  top: 10.8%;
  width: 12.3%;
  height: 15%;
  padding: 4px;
  border: 3px solid #a95d4a;
  background: #fff5e4;
  box-shadow: 0 3px 0 #d59b86;
  transform: rotate(2deg);
}
.album-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.album-frame .object-label {
  bottom: -16px;
}
.object-label {
  position: absolute;
  left: 50%;
  bottom: -10px;
  display: block;
  width: max-content;
  max-width: 140%;
  padding: 5px 10px 6px;
  border: 2px solid #a76859;
  border-radius: 100px;
  color: var(--ink);
  background: #fff8e9;
  box-shadow: 0 3px 0 #d59b86;
  font-size: clamp(10px, 2.4vw, 12px);
  font-weight: 800;
  line-height: 1.1;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  transform: translateX(-50%) rotate(-3deg);
}
.snack-object {
  left: 4.6%;
  top: 40%;
  width: 14.5%;
}
.couple-object {
  left: 31.2%;
  top: 39%;
  width: 39%;
}
.couple-label {
  bottom: -4%;
  transform: translateX(-50%) rotate(3deg);
}
.capsule-object {
  left: 79.5%;
  top: 46.4%;
  width: 16.7%;
}
.capsule-object .object-label {
  bottom: -11%;
}
.letter-object {
  left: 43%;
  top: 76.4%;
  width: 14%;
  transform: rotate(-8deg);
}
.letter-object .object-label {
  bottom: -24%;
  transform: translateX(-50%) rotate(7deg);
}

.creature-left,
.creature-right {
  transform-box: fill-box;
  transform-origin: center bottom;
}
.creature-left {
  animation: breathe-left 3.4s ease-in-out infinite;
}
.creature-right {
  animation: breathe-right 3.4s ease-in-out 0.3s infinite;
}
.room.is-hugging .creature-left {
  animation: snuggle-left 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.room.is-hugging .creature-right {
  animation: snuggle-right 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hug-spark {
  position: absolute;
  z-index: 3;
  top: 1%;
  color: #e87775;
  font-size: clamp(15px, 4vw, 26px);
  opacity: 0;
  pointer-events: none;
}
.spark-left {
  left: 25%;
}
.spark-right {
  right: 22%;
}
.room.is-hugging .hug-spark {
  animation: float-heart 1.3s ease-out both;
}
.room.is-hugging .spark-right {
  animation-delay: 0.16s;
}

.below-room {
  width: min(100%, 680px);
  margin: 13px auto 0;
}
.instruction {
  margin: 0 0 14px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}
.album-shortcut {
  display: block;
  min-width: 144px;
  min-height: 44px;
  margin: 5px auto 0;
  padding: 5px 12px;
  border: 1px solid #d4a394;
  border-radius: 999px;
  color: var(--coral-dark);
  background: #fff3df;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 0 #e5b8a8;
}
.album-shortcut:active {
  transform: translateY(1px);
}
.action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 49px;
  padding: 8px 10px;
  border: 2px solid #b67262;
  border-radius: 14px;
  color: var(--ink);
  background: #ffebdc;
  box-shadow: 0 4px 0 #d7a18e;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}
.action-button:nth-child(2) {
  background: #e7ead9;
  border-color: #819a7a;
  box-shadow: 0 4px 0 #afc2a1;
}
.action-button:nth-child(3) {
  background: #fff3d8;
  border-color: #be9974;
  box-shadow: 0 4px 0 #dac19a;
}
.action-button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #d7a18e;
}
.action-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  color: var(--coral-dark);
  font-size: 22px;
  line-height: 1;
}
.pat-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 11px;
}
.pat-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 5px 11px;
  border: 1px solid #d4a394;
  border-radius: 999px;
  color: var(--ink);
  background: #fff3df;
  font-size: 14px;
  font-weight: 800;
}
.pat-button .action-icon {
  flex-basis: 18px;
  font-size: 18px;
}
.pat-progress {
  min-width: 48px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.action-button:nth-child(2) .action-icon {
  color: #6b8b75;
}
.action-button:nth-child(3) .action-icon {
  color: #9c744e;
}
.message-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 49px;
  margin-top: 18px;
  padding: 9px 18px;
  border: 1.5px dashed #d8aa95;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
}
.message-heart {
  color: var(--coral);
  font-size: 17px;
}
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 33px 0 24px;
  color: #805a53;
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: italic;
  letter-spacing: 0.025em;
}
.footer span:last-child {
  color: var(--coral);
  font-family: sans-serif;
  font-size: 17px;
  font-style: normal;
}

.surprise-dialog {
  width: min(calc(100% - 32px), 460px);
  max-height: min(90vh, 760px);
  padding: 0;
  border: 3px solid #ab6e5c;
  border-radius: 25px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 10px 0 #c88871;
}
.surprise-dialog::backdrop {
  background: rgba(64, 42, 38, 0.53);
  backdrop-filter: blur(3px);
}
.dialog-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 42px 27px 32px;
  text-align: center;
}
.surprise-dialog[data-kind="album"] .dialog-inner {
  max-height: min(90vh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.album-viewer {
  width: 100%;
}
.album-photo {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 55vh;
  margin: 16px auto;
  object-fit: contain;
  touch-action: pan-y;
}
.album-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}
.album-control {
  min-width: 76px;
  min-height: 44px;
  padding: 6px 12px;
  border: 2px solid #b67262;
  border-radius: 13px;
  color: var(--ink);
  background: #ffebdc;
  font-weight: 800;
}
.photo-count {
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.dialog-inner::before {
  content: "";
  position: absolute;
  inset: 9px;
  z-index: -1;
  border: 2px dashed #e1b8a6;
  border-radius: 17px;
  pointer-events: none;
}
.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid #dab2a0;
  border-radius: 13px;
  color: var(--ink);
  background: #fff2df;
  font-size: 29px;
  line-height: 1;
}
.dialog-doodle {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  margin-bottom: 10px;
  border: 3px solid #c78b78;
  border-radius: 50%;
  color: var(--coral-dark);
  background: #f7dcc8;
  box-shadow: 0 5px 0 #eab6a0;
  font-family: Georgia, serif;
  font-size: 54px;
  line-height: 1;
  transform: rotate(-12deg);
}
.dialog-kicker {
  margin: 16px 0 7px;
  color: var(--coral-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.09em;
}
.dialog-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.surprise-dialog h2 {
  max-width: 13em;
  margin: 0;
  font-size: clamp(25px, 6vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.035em;
}
.dialog-copy {
  max-width: 31em;
  margin: 18px 0 25px;
  color: #634a43;
  font-size: 16px;
  line-height: 1.8;
  white-space: pre-line;
}
.dialog-action {
  min-height: 48px;
  min-width: 160px;
  padding: 10px 24px;
  border: 2px solid #a45e54;
  border-radius: 14px;
  color: #fffdf6;
  background: var(--coral-dark);
  box-shadow: 0 4px 0 #82463f;
  font-size: 15px;
  font-weight: 800;
}
.dialog-action:active {
  box-shadow: 0 1px 0 #82463f;
}
.dialog-action:disabled {
  cursor: wait;
  opacity: 0.7;
}
.surprise-dialog.is-drawing .dialog-doodle {
  animation: capsule-turn 0.55s ease-in-out;
}
.room.is-patting .creature-left,
.room.is-patting .creature-right {
  animation: belly-squish 0.38s ease-in-out;
}
.room.is-patting .hug-spark {
  opacity: 1;
  transform: translateY(-18px) scale(1.1);
}
.surprise-dialog[data-kind="letter"] .dialog-doodle {
  background: #fff0d0;
  color: #b97b5c;
  transform: rotate(8deg);
}
.surprise-dialog[data-kind="snack"] .dialog-doodle {
  background: var(--mint);
  color: #688a72;
}
.surprise-dialog[data-kind="capsule"] .dialog-doodle {
  background: #e4d9e9;
  color: #87678c;
}

@keyframes breathe-left {
  50% {
    transform: translateY(2px) rotate(-1deg);
  }
}
@keyframes breathe-right {
  50% {
    transform: translateY(2px) rotate(1deg);
  }
}
@keyframes snuggle-left {
  50% {
    transform: translateX(15px) rotate(6deg);
  }
  100% {
    transform: translateX(9px) rotate(3deg);
  }
}
@keyframes snuggle-right {
  50% {
    transform: translateX(-15px) rotate(-6deg);
  }
  100% {
    transform: translateX(-9px) rotate(-3deg);
  }
}
@keyframes float-heart {
  0% {
    opacity: 0;
    transform: translateY(15px) scale(0.5) rotate(-14deg);
  }
  20%,
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-75px) scale(1.3) rotate(16deg);
  }
}
@keyframes capsule-turn {
  50% {
    transform: rotate(24deg) scale(1.13);
  }
}
@keyframes belly-squish {
  50% {
    transform: scale(1.05, 0.92);
  }
}

@media (hover: hover) and (pointer: fine) {
  .scene-button:hover {
    transform: translateY(-5px) rotate(-1deg);
  }
  .letter-object:hover {
    transform: translateY(-4px) rotate(-12deg);
  }
  .action-button:hover {
    filter: brightness(1.025);
    transform: translateY(-2px);
  }
  .dialog-close:hover {
    background: #ffe7d7;
  }
  .dialog-action:hover {
    background: #9b4646;
  }
  .album-shortcut:hover {
    color: #813f3d;
  }
}

@media (min-width: 800px) {
  .topbar {
    padding-top: 28px;
  }
  .intro {
    padding-top: 12px;
  }
  .room-wrap {
    margin-top: 18px;
  }
}

@media (max-width: 440px) {
  .page-shell {
    padding: 0 14px;
  }
  .topbar {
    min-height: 67px;
    padding-top: 12px;
  }
  .intro {
    padding-top: 16px;
  }
  .intro-subtitle {
    max-width: 23em;
    font-size: 14px;
  }
  .star-one {
    top: 56px;
    left: 0;
    font-size: 21px;
  }
  .star-two {
    top: 103px;
    right: 0;
    font-size: 17px;
  }
  .room-wrap {
    margin-top: 28px;
  }
  .album-frame {
    left: 75.5%;
    top: 10.5%;
  }
  .object-label {
    bottom: -18%;
    padding: 4px 5px 5px;
    border-width: 1.5px;
    font-size: 10px;
  }
  .couple-label {
    bottom: -6%;
  }
  .capsule-object .object-label {
    bottom: -18%;
  }
  .letter-object .object-label {
    bottom: -37%;
  }
  .action-row {
    gap: 7px;
  }
  .action-button {
    flex-direction: column;
    gap: 2px;
    min-height: 59px;
    padding: 6px 2px;
    font-size: 12px;
  }
  .action-icon {
    font-size: 19px;
  }
  .message-strip {
    margin-top: 15px;
    font-size: 13px;
  }
  .footer {
    padding-top: 27px;
  }
}

@media (max-width: 330px) {
  h1 {
    font-size: 34px;
  }
  .intro-subtitle {
    font-size: 13px;
  }
  .object-label {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .room.is-hugging .creature-left {
    transform: translateX(9px) rotate(3deg);
  }
  .room.is-hugging .creature-right {
    transform: translateX(-9px) rotate(-3deg);
  }
  .room.is-hugging .hug-spark {
    opacity: 1;
    transform: translateY(-22px);
  }
  .room.is-patting .creature-left,
  .room.is-patting .creature-right {
    animation: none;
    transform: scale(1.02, 0.97);
  }
}

[hidden] {
  display: none !important;
}
