:root {
  color: #522135;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #fff0f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button {
  font: inherit;
}

.page {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  padding: max(32px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(32px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.38) 0 25%, transparent 25% 50%) 0 0 / 34px 34px,
    linear-gradient(135deg, #fff8fb 0%, #ffd8e8 50%, #f7a9ca 100%);
}

.proposal-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  min-height: 460px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: clamp(30px, 7vw, 68px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 28px 80px rgba(180, 53, 105, 0.22);
  text-align: center;
  backdrop-filter: blur(20px);
  animation: card-in 520ms ease both;
  isolation: isolate;
  overflow: hidden;
}

.proposal-shell::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.48) 42%,
    transparent 58%
  );
  transform: translateX(-125%);
  animation: soft-shine 5.8s ease-in-out infinite;
}

.eyebrow {
  margin: 0 0 14px;
  color: #b72767;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  max-width: 620px;
  margin: 0;
  color: #8c174a;
  font-size: 5.35rem;
  line-height: 0.95;
  letter-spacing: 0;
}

p {
  max-width: 560px;
  margin: 22px auto 0;
  color: #6d2b47;
  font-size: 1.16rem;
  line-height: 1.7;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 34px;
}

.yes-button,
.no-button {
  position: relative;
  overflow: hidden;
  min-width: 132px;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  padding: 0 26px;
  cursor: pointer;
  font-weight: 900;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.yes-button {
  color: white;
  background: linear-gradient(135deg, #ff4f9a, #d91d73);
  box-shadow: 0 16px 34px rgba(217, 29, 115, 0.3);
  animation: button-glow 2.4s ease-in-out infinite;
}

.yes-button::after,
.no-button::after {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  content: "";
  background: rgba(255, 255, 255, 0.58);
  opacity: 0;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: none;
}

.secondary-yes {
  background: linear-gradient(135deg, #ff78b5, #ff3b8f);
}

.no-button {
  color: #9b2357;
  background: #fff;
  box-shadow: inset 0 0 0 2px rgba(255, 115, 169, 0.35);
}

.yes-button:hover,
.no-button:hover {
  transform: translateY(-2px);
}

.yes-button:active,
.no-button:active {
  transform: translateY(1px) scale(0.97);
}

.yes-button:active::after,
.no-button:active::after {
  animation: tap-ripple 460ms ease-out;
}

.yes-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
  animation: none;
}

.hint {
  min-height: 26px;
  margin-top: 22px;
  color: #a51c5b;
  font-weight: 700;
}

.reset-button {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 3;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(155, 35, 87, 0.16);
  border-radius: 50%;
  padding: 0;
  color: rgba(109, 43, 71, 0.66);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 10px 24px rgba(180, 53, 105, 0.08);
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition:
    background 180ms ease,
    color 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.reset-button:hover {
  color: #9b2357;
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
}

.reset-button:active {
  transform: scale(0.92);
}

.reset-button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.reset-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.reset-icon.spinning {
  animation: spin 720ms linear infinite;
}

.accepted {
  display: grid;
  justify-items: center;
  animation: accepted-in 560ms ease both;
}

.ring {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #ff4f9a, #ffb0d0);
  box-shadow:
    0 20px 40px rgba(217, 29, 115, 0.26),
    inset 0 0 0 9px rgba(255, 255, 255, 0.26);
  font-weight: 950;
  animation: yes-pop 900ms ease both;
}

.stamp {
  margin-top: 28px;
  border-radius: 999px;
  padding: 12px 18px;
  color: #9b2357;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  font-weight: 800;
}

.loading-state {
  min-height: 300px;
}

.heartbeat {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ff4f9a;
  animation: beat 900ms ease-in-out infinite;
}

.heart-burst {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.heart-burst span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 5px 5px 0 5px;
  background: rgba(255, 65, 145, 0.44);
  animation: burst-heart 1300ms ease-out both;
}

.heart-burst span::before,
.heart-burst span::after {
  position: absolute;
  width: 18px;
  height: 18px;
  content: "";
  border-radius: 50%;
  background: inherit;
}

.heart-burst span::before {
  left: -9px;
}

.heart-burst span::after {
  top: -9px;
}

.heart-burst span:nth-child(1) {
  --x: -146px;
  --y: -112px;
}

.heart-burst span:nth-child(2) {
  --x: 138px;
  --y: -92px;
  animation-delay: 80ms;
}

.heart-burst span:nth-child(3) {
  --x: -128px;
  --y: 104px;
  animation-delay: 140ms;
}

.heart-burst span:nth-child(4) {
  --x: 122px;
  --y: 112px;
  animation-delay: 210ms;
}

.heart-burst span:nth-child(5) {
  --x: 0;
  --y: -154px;
  animation-delay: 260ms;
}

.heart-burst span:nth-child(6) {
  --x: 0;
  --y: 150px;
  animation-delay: 310ms;
}

.sparkles,
.celebration-sparkles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.sparkles span,
.celebration-sparkles span {
  position: absolute;
  width: 8px;
  height: 8px;
  color: rgba(255, 255, 255, 0.92);
  transform: rotate(45deg);
}

.sparkles span::before,
.sparkles span::after,
.celebration-sparkles span::before,
.celebration-sparkles span::after {
  position: absolute;
  inset: 0;
  content: "";
  border-radius: 999px;
  background: currentColor;
}

.sparkles span::before,
.celebration-sparkles span::before {
  transform: scaleX(0.28);
}

.sparkles span::after,
.celebration-sparkles span::after {
  transform: scaleY(0.28);
}

.sparkles span {
  animation: twinkle 3.8s ease-in-out infinite;
}

.sparkles span:nth-child(1) {
  left: 11%;
  top: 28%;
}

.sparkles span:nth-child(2) {
  right: 16%;
  top: 34%;
  animation-delay: -0.8s;
}

.sparkles span:nth-child(3) {
  left: 25%;
  top: 12%;
  animation-delay: -1.4s;
}

.sparkles span:nth-child(4) {
  right: 26%;
  bottom: 22%;
  animation-delay: -2s;
}

.sparkles span:nth-child(5) {
  left: 13%;
  bottom: 30%;
  animation-delay: -2.7s;
}

.sparkles span:nth-child(6) {
  right: 9%;
  bottom: 39%;
  animation-delay: -3.2s;
}

.sparkles span:nth-child(7) {
  left: 45%;
  top: 17%;
  animation-delay: -1.9s;
}

.sparkles span:nth-child(8) {
  left: 54%;
  bottom: 14%;
  animation-delay: -0.3s;
}

.celebration-sparkles span {
  left: 50%;
  top: 50%;
  animation: sparkle-pop 980ms ease-out both;
}

.celebration-sparkles span:nth-child(1) {
  --sx: -178px;
  --sy: -132px;
}

.celebration-sparkles span:nth-child(2) {
  --sx: 168px;
  --sy: -118px;
  animation-delay: 90ms;
}

.celebration-sparkles span:nth-child(3) {
  --sx: -154px;
  --sy: 132px;
  animation-delay: 150ms;
}

.celebration-sparkles span:nth-child(4) {
  --sx: 158px;
  --sy: 128px;
  animation-delay: 220ms;
}

.celebration-sparkles span:nth-child(5) {
  --sx: -28px;
  --sy: -178px;
  animation-delay: 280ms;
}

.celebration-sparkles span:nth-child(6) {
  --sx: 32px;
  --sy: 178px;
  animation-delay: 340ms;
}

.floating-hearts span {
  position: absolute;
  width: 24px;
  height: 24px;
  transform: rotate(45deg);
  border-radius: 6px 6px 0 6px;
  background: rgba(255, 88, 153, 0.24);
  animation: float 8s ease-in-out infinite;
}

.floating-hearts span::before,
.floating-hearts span::after {
  position: absolute;
  width: 24px;
  height: 24px;
  content: "";
  border-radius: 50%;
  background: inherit;
}

.floating-hearts span::before {
  left: -12px;
}

.floating-hearts span::after {
  top: -12px;
}

.floating-hearts span:nth-child(1) {
  left: 9%;
  top: 16%;
}

.floating-hearts span:nth-child(2) {
  right: 12%;
  top: 18%;
  animation-delay: -1.6s;
}

.floating-hearts span:nth-child(3) {
  left: 18%;
  bottom: 14%;
  animation-delay: -3.1s;
}

.floating-hearts span:nth-child(4) {
  right: 22%;
  bottom: 12%;
  animation-delay: -4.2s;
}

.floating-hearts span:nth-child(5) {
  left: 50%;
  top: 9%;
  animation-delay: -5.4s;
}

@keyframes beat {
  0%,
  100% {
    transform: scale(0.92);
  }

  50% {
    transform: scale(1.06);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(45deg);
  }

  50% {
    transform: translateY(-26px) rotate(45deg);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes soft-shine {
  0%,
  38% {
    transform: translateX(-125%);
  }

  64%,
  100% {
    transform: translateX(125%);
  }
}

@keyframes tap-ripple {
  0% {
    opacity: 0.65;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(18);
  }
}

@keyframes burst-heart {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(45deg) scale(0.4);
  }

  22% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(45deg) scale(1);
  }
}

@keyframes accepted-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes yes-pop {
  0% {
    transform: scale(0.72);
  }

  58% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes button-glow {
  0%,
  100% {
    box-shadow: 0 16px 34px rgba(217, 29, 115, 0.3);
  }

  50% {
    box-shadow:
      0 16px 34px rgba(217, 29, 115, 0.34),
      0 0 0 8px rgba(255, 79, 154, 0.12);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.2;
    transform: rotate(45deg) scale(0.58);
  }

  45% {
    opacity: 0.9;
    transform: rotate(45deg) scale(1);
  }
}

@keyframes sparkle-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(45deg) scale(0.4);
  }

  26% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--sx)), calc(-50% + var(--sy))) rotate(45deg) scale(1.15);
  }
}

@media (max-width: 760px) {
  h1 {
    font-size: 4rem;
  }
}

@media (max-width: 560px) {
  .page {
    padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
      max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  }

  .proposal-shell {
    min-height: 520px;
    border-radius: 22px;
    padding: 34px 22px 44px;
  }

  .button-row {
    width: 100%;
  }

  .yes-button,
  .no-button {
    width: min(100%, 260px);
  }

  .reset-button {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 430px) {
  .page {
    align-items: center;
  }

  .proposal-shell {
    width: 100%;
    min-height: min(620px, calc(100dvh - 44px));
    padding: 30px 18px 54px;
  }

  .eyebrow {
    margin-bottom: 12px;
    font-size: 0.74rem;
    letter-spacing: 0.12em;
  }

  h1 {
    max-width: 330px;
    font-size: 3.18rem;
    line-height: 1;
  }

  p {
    max-width: 330px;
    margin-top: 18px;
    font-size: 1.02rem;
    line-height: 1.58;
  }

  .button-row {
    gap: 12px;
    margin-top: 28px;
  }

  .yes-button,
  .no-button {
    min-height: 54px;
    width: min(100%, 240px);
  }

  .ring {
    width: 94px;
    height: 94px;
    margin-bottom: 18px;
  }

  .stamp {
    max-width: 100%;
    margin-top: 22px;
    font-size: 0.86rem;
    line-height: 1.45;
  }

  .heart-burst span:nth-child(1) {
    --x: -96px;
    --y: -106px;
  }

  .heart-burst span:nth-child(2) {
    --x: 98px;
    --y: -92px;
  }

  .heart-burst span:nth-child(3) {
    --x: -96px;
    --y: 98px;
  }

  .heart-burst span:nth-child(4) {
    --x: 96px;
    --y: 106px;
  }

  .heart-burst span:nth-child(5) {
    --x: 0;
    --y: -126px;
  }

  .heart-burst span:nth-child(6) {
    --x: 0;
    --y: 124px;
  }

  .celebration-sparkles span:nth-child(1) {
    --sx: -116px;
    --sy: -132px;
  }

  .celebration-sparkles span:nth-child(2) {
    --sx: 116px;
    --sy: -120px;
  }

  .celebration-sparkles span:nth-child(3) {
    --sx: -112px;
    --sy: 122px;
  }

  .celebration-sparkles span:nth-child(4) {
    --sx: 112px;
    --sy: 128px;
  }

  .celebration-sparkles span:nth-child(5) {
    --sx: -18px;
    --sy: -154px;
  }

  .celebration-sparkles span:nth-child(6) {
    --sx: 20px;
    --sy: 150px;
  }
}

@media (max-width: 360px) {
  h1 {
    font-size: 2.72rem;
  }

  p {
    font-size: 0.96rem;
  }
}

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