* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff0f5;
  color: #563b58;
  font-family: "Trebuchet MS", Arial, sans-serif;
}

.scene {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  min-height: 440px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(180deg, #ffe1ed 0%, #fffafd 58%, #fff1e8 100%);
  box-shadow: 0 18px 45px #d990ae35, inset 0 0 0 8px #ffffff80;
}

.character {
  position: relative;
  z-index: 1;
  width: 150px;
  height: 220px;
  animation: bounce 0.6s ease-in-out infinite alternate;
}

.body {
  position: absolute;
  top: 35px;
  left: 25px;
  z-index: 2;
  width: 100px;
  height: 112px;
  border: 4px solid #65445f;
  border-radius: 48% 48% 43% 43%;
  background: #fffdfd;
  box-shadow: inset -8px -7px 0 #ffe4ef;
}

.body::before,
.body::after {
  content: "";
  position: absolute;
  top: -15px;
  z-index: -1;
  width: 25px;
  height: 25px;
  border: 4px solid #65445f;
  border-radius: 50% 50% 42% 42%;
  background: #ffb8d0;
}

.body::before { left: 7px; transform: rotate(-22deg); }
.body::after { right: 7px; transform: rotate(22deg); }

.face {
  position: absolute;
  top: 37px;
  left: 0;
  width: 100%;
  height: 40px;
}

.eye {
  position: absolute;
  top: 1px;
  width: 7px;
  height: 10px;
  border-radius: 50%;
  background: #65445f;
}

.eye-left { left: 25px; }
.eye-right { right: 25px; }

.cheek {
  position: absolute;
  top: 16px;
  width: 14px;
  height: 8px;
  border-radius: 50%;
  background: #ff9fbd;
  opacity: 0.85;
}

.cheek-left { left: 12px; }
.cheek-right { right: 12px; }

.smile {
  position: absolute;
  top: 12px;
  left: 39px;
  width: 17px;
  height: 10px;
  border-bottom: 3px solid #65445f;
  border-radius: 0 0 50% 50%;
}

.arm {
  position: absolute;
  z-index: 1;
  top: 68px;
  width: 24px;
  height: 67px;
  border: 4px solid #65445f;
  border-radius: 20px;
  background: #ffb8d0;
  transform-origin: 50% 12px;
}

.arm-left {
  left: 15px;
  animation: swing-left 0.6s ease-in-out infinite alternate;
}

.arm-right {
  right: 15px;
  animation: swing-right 0.6s ease-in-out infinite alternate;
}

.leg {
  position: absolute;
  z-index: 1;
  top: 136px;
  width: 23px;
  height: 63px;
  border: 4px solid #65445f;
  border-radius: 0 0 14px 14px;
  background: #ffd0e0;
  transform-origin: 50% 4px;
}

.leg-left {
  left: 48px;
  animation: swing-right 0.6s ease-in-out infinite alternate;
}

.leg-right {
  right: 48px;
  animation: swing-left 0.6s ease-in-out infinite alternate;
}

.shoe {
  position: absolute;
  bottom: -5px;
  left: -11px;
  width: 34px;
  height: 15px;
  border: 4px solid #65445f;
  border-radius: 12px 12px 8px 8px;
  background: #ff8fb4;
}

.ground-shadow {
  position: absolute;
  top: 305px;
  width: 90px;
  height: 16px;
  border-radius: 50%;
  background: #9d6b88;
  opacity: 0.15;
  animation: shadow 0.6s ease-in-out infinite alternate;
}

h1 {
  margin: 35px 0 5px;
  font-size: 1.6rem;
}

p {
  max-width: 290px;
  margin: 0;
  color: #a45878;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

.response-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 450ms ease, transform 450ms ease, visibility 0s linear 450ms;
}

.response-buttons.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

.response-button {
  min-width: 100px;
  padding: 10px 18px;
  border: 2px solid #e89ab9;
  border-radius: 999px;
  background: #fff;
  color: #a45878;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 #f4c2d4;
  transition: transform 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.response-button:hover {
  transform: translateY(-2px);
  background: #fff0f6;
  box-shadow: 0 6px 0 #f4c2d4;
}

.response-button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #f4c2d4;
}

.sure-button { background: #ffe1ed; }

.scene.is-sure .eye {
  top: 4px;
  width: 10px;
  height: 6px;
  border: 0;
  border-top: 2px solid #65445f;
  border-radius: 50% 50% 0 0;
  background: transparent;
}

.scene.is-sorry .character,
.scene.is-sorry .arm,
.scene.is-sorry .leg,
.scene.is-sorry .ground-shadow {
  animation: none;
}

.scene.is-sorry .eye {
  top: 5px;
  height: 4px;
  border-radius: 50% 50% 0 0;
  border-top: 2px solid #65445f;
  background: transparent;
}

.scene.is-sorry .smile {
  border-bottom: 0;
  border-top: 3px solid #65445f;
  border-radius: 50% 50% 0 0;
}

.sparkle {
  position: absolute;
  color: #ff85ad;
  animation: twinkle 1.2s ease-in-out infinite alternate;
}

.sparkle-one {
  top: 95px;
  left: 85px;
  font-size: 2rem;
}

.sparkle-two {
  top: 155px;
  right: 88px;
  color: #e89ab9;
  font-size: 2.5rem;
  animation-delay: 0.5s;
}

.message {
  transition: opacity 700ms ease, transform 700ms ease;
}

.message.is-changing {
  opacity: 0;
  transform: translateY(6px);
}

.scene[hidden],
.date-view[hidden] {
  display: none;
}

.date-view {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #ffe1ed 0%, #fffafd 58%, #fff1e8 100%);
  text-align: center;
}

.waiting-message {
  position: absolute;
  top: 34%;
  left: 50%;
  width: min(360px, calc(100% - 48px));
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 700ms ease;
}

.date-view.show-message .waiting-message {
  opacity: 1;
}

.date-view.hide-message .waiting-message {
  opacity: 0;
}

.clock-card {
  position: relative;
  isolation: isolate;
  width: min(100%, 320px);
  padding: 22px 24px 25px;
  border: 4px solid #d59abb;
  border-radius: 28px;
  background: linear-gradient(145deg, #f9d9eb, #efc6df);
  box-shadow: inset 0 0 0 4px #fff4fa, inset 0 -8px 0 #e8bbd7;
  opacity: 0;
  transform: translateY(0) scale(1);
  transform-origin: center top;
  transition: opacity 900ms ease, transform 3s cubic-bezier(0.2, 0.7, 0.25, 1);
}

.clock-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 24px 15px 20px;
  border: 3px solid #704f70;
  border-radius: 14px;
  background: #463b59;
  box-shadow: inset 0 0 12px #211d31;
}

.clock-card::after {
  content: "";
  position: absolute;
  z-index: -2;
  right: 18%;
  bottom: -22px;
  left: 18%;
  height: 12px;
  border-radius: 50%;
  background: #76566b;
  filter: blur(7px);
  opacity: 0;
  transform: scaleX(0.7);
  transition: opacity 900ms ease, transform 900ms ease;
}

.clock-label {
  margin: 0 0 9px;
  color: #fff2fa;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.3em;
}

.countdown {
  display: block;
  color: #ffb6d7;
  font-family: "Courier New", monospace;
  font-size: clamp(3.5rem, 15vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  text-shadow: 0 0 12px #ff90c5;
  font-variant-numeric: tabular-nums;
}

.date-view.show-clock .clock-card {
  opacity: 1;
}

.date-view.lower-clock .clock-card {
  transform: translateY(20vh) scale(0.69);
}

.date-view.clock-settled .clock-card::after {
  opacity: 0.3;
  transform: scaleX(1);
}

.cloud-transition {
  position: fixed;
  z-index: 10;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
}

.cloud-transition.is-active { visibility: visible; }

.cloud {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 130vw;
  height: 130vh;
  border-radius: 48% 52% 54% 46%;
  background: #fff;
  box-shadow: 0 0 45px 14px #fff;
  opacity: 0;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  width: 58vw;
  height: 58vw;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 35px 12px #fff;
}

.cloud-left::before { top: 8%; right: 5%; }
.cloud-left::after { right: 2%; bottom: 12%; }
.cloud-right::before { top: 8%; left: 5%; }
.cloud-right::after { bottom: 12%; left: 2%; }
.cloud-top::before { bottom: 4%; left: 8%; }
.cloud-top::after { right: 10%; bottom: 2%; }
.cloud-bottom::before { top: 4%; left: 8%; }
.cloud-bottom::after { top: 2%; right: 10%; }

.cloud-left { animation-name: cloud-from-left; }
.cloud-right { animation-name: cloud-from-right; }
.cloud-top { animation-name: cloud-from-top; }
.cloud-bottom { animation-name: cloud-from-bottom; }

.cloud-transition.is-active .cloud {
  animation-duration: 3.6s;
  animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
  animation-fill-mode: both;
}

@keyframes cloud-from-left {
  0% { opacity: 0; transform: translate(-150%, -50%); }
  12%, 58% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-150%, -50%); }
}

@keyframes cloud-from-right {
  0% { opacity: 0; transform: translate(150%, -50%); }
  12%, 58% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(150%, -50%); }
}

@keyframes cloud-from-top {
  0% { opacity: 0; transform: translate(-50%, -150%); }
  12%, 58% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, -150%); }
}

@keyframes cloud-from-bottom {
  0% { opacity: 0; transform: translate(-50%, 150%); }
  12%, 58% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, 150%); }
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-13px); }
}

@keyframes swing-left {
  from { transform: rotate(25deg); }
  to { transform: rotate(-25deg); }
}

@keyframes swing-right {
  from { transform: rotate(-25deg); }
  to { transform: rotate(25deg); }
}

@keyframes shadow {
  from { transform: scaleX(1); opacity: 0.15; }
  to { transform: scaleX(0.72); opacity: 0.08; }
}

@keyframes twinkle {
  from { transform: scale(0.8) rotate(-12deg); opacity: 0.55; }
  to { transform: scale(1.15) rotate(12deg); opacity: 1; }
}

@keyframes reveal-title {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .date-view.is-visible h1 {
    opacity: 1;
    transform: none;
  }
}
