:root {
  /* Cherry-blossom theme (from your reference art) */
  --ink: #3d2c24;
  --muted: #7a655c;
  --cream: #fff8fb;
  --blush: #ffd1dc;
  --blossom: #ffb7c5;
  --blossom-deep: #f5a0b2;
  --rose: #e8a0b0;
  --rose-deep: #c0607a;
  --white-glow: #fffafd;
  --stem: #c8d9b8;
  --card: rgba(255, 250, 253, 0.92);
  --shadow: 0 20px 48px rgba(61, 44, 36, 0.1);
  --shadow-pink: 0 12px 32px rgba(255, 160, 178, 0.35);
  --radius: 24px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Quicksand", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(165deg, var(--white-glow) 0%, #fff0f5 38%, var(--blush) 72%, #ffe4ec 100%);
  overflow-x: visible;
  overflow-y: auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: url("assets/theme-reference.png") center / cover no-repeat;
  opacity: 0.1;
}

.bg-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(ellipse 100% 80% at 50% -20%, rgba(255, 183, 197, 0.32) 0%, transparent 55%),
    radial-gradient(circle at 12% 88%, rgba(255, 209, 220, 0.45) 0%, transparent 42%),
    radial-gradient(circle at 92% 78%, rgba(255, 183, 197, 0.32) 0%, transparent 40%),
    radial-gradient(circle at 70% 12%, rgba(200, 217, 184, 0.18) 0%, transparent 35%);
}

@media (prefers-reduced-motion: no-preference) {
  body::before {
    animation: bg-drift 32s ease-in-out infinite alternate;
  }
}

@keyframes bg-drift {
  from {
    transform: scale(1) translate(0, 0);
  }
  to {
    transform: scale(1.04) translate(-1.5%, 1%);
  }
}

.screen {
  min-height: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

.screen.hidden {
  display: none;
}

.card {
  position: relative;
  width: min(440px, 100%);
  background: var(--card);
  backdrop-filter: blur(14px);
  border-radius: var(--radius);
  padding: 36px 28px 40px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 183, 197, 0.35);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.85);
  overflow: visible;
}

.card::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -42%);
  width: 118%;
  height: 100px;
  pointer-events: none;
  background: radial-gradient(ellipse 28px 18px at 8% 70%, rgba(255, 183, 197, 0.55) 0%, transparent 58%),
    radial-gradient(ellipse 22px 14px at 22% 45%, rgba(255, 209, 220, 0.7) 0%, transparent 55%),
    radial-gradient(ellipse 26px 16px at 38% 78%, rgba(255, 183, 197, 0.5) 0%, transparent 56%),
    radial-gradient(ellipse 24px 15px at 50% 40%, rgba(255, 183, 197, 0.65) 0%, transparent 54%),
    radial-gradient(ellipse 22px 14px at 62% 72%, rgba(255, 209, 220, 0.65) 0%, transparent 55%),
    radial-gradient(ellipse 28px 18px at 78% 48%, rgba(255, 183, 197, 0.55) 0%, transparent 58%),
    radial-gradient(ellipse 24px 15px at 92% 68%, rgba(255, 183, 197, 0.5) 0%, transparent 56%);
  filter: blur(0.5px);
}

.icon-badge {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border-radius: 22px;
  background: linear-gradient(145deg, var(--blush), var(--blossom));
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-pink);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .icon-badge {
    animation: badge-glow 4s ease-in-out infinite;
  }
}

@keyframes badge-glow {
  0%,
  100% {
    box-shadow: var(--shadow-pink);
  }
  50% {
    box-shadow: 0 14px 40px rgba(255, 160, 178, 0.45);
  }
}

.sister-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.sister-photo.loaded {
  display: block;
}

.icon-fallback {
  font-size: 2.25rem;
  line-height: 1;
}

.sister-photo.loaded + .icon-fallback {
  display: none;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 2.5rem);
  line-height: 1.12;
  margin: 0 0 16px;
  color: var(--ink);
  position: relative;
  z-index: 1;
}

.subtitle {
  margin: 0 0 30px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.subtitle strong {
  color: var(--rose-deep);
  font-weight: 700;
}

.actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 52px;
  z-index: 1;
}

/* Injected beside Yes while No is position:fixed so the row doesn’t collapse */
.no-flee-placeholder {
  flex-shrink: 0;
  pointer-events: none;
  visibility: hidden;
}

.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  min-height: 44px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-yes {
  flex-shrink: 0;
  background: linear-gradient(145deg, var(--blossom), var(--blossom-deep));
  color: var(--white-glow);
  box-shadow: var(--shadow-pink);
  text-shadow: 0 1px 0 rgba(61, 44, 36, 0.12);
}

.btn-yes:hover {
  transform: translateY(-2px);
  background: linear-gradient(145deg, var(--blossom-deep), var(--rose));
  box-shadow: 0 16px 40px rgba(255, 160, 178, 0.42);
}

.btn-yes:active {
  transform: translateY(0);
}

.btn-no {
  flex-shrink: 0;
  background: var(--white-glow);
  color: var(--muted);
  border: 2px solid rgba(255, 183, 197, 0.85);
  position: relative;
  z-index: 2;
  min-width: 88px;
}

.btn-no:hover {
  border-color: var(--blossom);
  color: var(--rose-deep);
}

.btn-flourish {
  font-size: 0.9em;
  opacity: 0.85;
}

.btn-no.is-floating {
  position: fixed;
  z-index: 9999;
  margin: 0;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.btn-ghost {
  background: transparent;
  color: var(--rose-deep);
  border: 2px solid rgba(255, 183, 197, 0.55);
  margin-top: 8px;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.75);
  border-color: var(--blossom);
}

/* Wish screen */
.card-wish {
  position: relative;
  overflow: hidden;
}

.confetti {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--blossom) 1.5px, transparent 1.5px),
    radial-gradient(circle, var(--blush) 1.5px, transparent 1.5px),
    radial-gradient(circle, var(--stem) 1px, transparent 1px);
  background-size: 22px 22px, 30px 30px, 26px 26px;
  background-position: 0 0, 11px 7px, 5px 12px;
  opacity: 0.4;
  pointer-events: none;
}

.wish-title {
  position: relative;
}

.wish-body {
  position: relative;
  text-align: left;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
  margin: 0 0 20px;
  font-weight: 500;
}

.signature {
  position: relative;
  margin: 0 0 16px;
  font-style: italic;
  color: var(--ink);
  font-weight: 600;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.15rem;
}

.wish-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.wish-actions .btn-ghost {
  margin-top: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(61, 44, 36, 0.38);
  backdrop-filter: blur(6px);
}

.modal-backdrop.hidden {
  display: none;
}

.modal-panel {
  width: min(360px, 100%);
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 183, 197, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.modal-message {
  margin: 0 0 22px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.5rem, 5vw, 1.85rem);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.modal-close-btn {
  min-width: 120px;
}

/* Falling mini cakes when entering the wish screen */
.cake-rain-layer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  overflow: hidden;
}

.cake-rain-piece {
  position: absolute;
  left: var(--x, 50%);
  top: -3rem;
  font-size: var(--size, 1.25rem);
  line-height: 1;
  animation: cake-rain-fall var(--dur, 3s) cubic-bezier(0.28, 0.55, 0.45, 1) var(--delay, 0s) forwards;
  filter: drop-shadow(0 2px 5px rgba(61, 44, 36, 0.14));
}

@keyframes cake-rain-fall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--sway, 0px), calc(100vh + 4rem), 0) rotate(var(--rot, 240deg));
    opacity: 0.88;
  }
}

/* —— Tablets & large phones —— */
@media (max-width: 640px) {
  .screen {
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
      max(20px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  }

  .card {
    padding: 28px 20px 32px;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
  }

  .card::before {
    height: 88px;
  }

  .modal-backdrop {
    padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
      max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  }

  .modal-panel {
    padding: 24px 20px 22px;
  }
}

/* —— Phones —— */
@media (max-width: 480px) {
  .title {
    font-size: clamp(1.6rem, 9vw, 2.15rem);
  }

  .wish-title {
    font-size: clamp(1.55rem, 8.5vw, 2rem);
  }

  .subtitle,
  .wish-body {
    font-size: 0.98rem;
    line-height: 1.62;
  }

  .subtitle {
    margin-bottom: 22px;
  }

  .icon-badge {
    width: 68px;
    height: 68px;
    margin-bottom: 14px;
  }

  .btn {
    min-height: 48px;
    padding: 12px 18px;
    font-size: 0.94rem;
  }

  .actions {
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
    gap: 10px;
    align-items: stretch;
  }

  .actions .btn-yes,
  .actions .btn-no {
    width: 100%;
    max-width: none;
    flex-shrink: 1;
  }

  .wish-actions {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
    gap: 10px;
  }

  .wish-actions .btn-yes,
  .wish-actions .btn-ghost {
    width: 100%;
    max-width: none;
  }

  .modal-message {
    font-size: clamp(1.35rem, 6.5vw, 1.65rem);
  }

  .modal-close-btn {
    width: 100%;
    max-width: 220px;
  }
}

/* —— Very narrow / small screens —— */
@media (max-width: 360px) {
  .eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
  }

  .card {
    padding: 22px 16px 26px;
  }

  .signature {
    font-size: 1.05rem;
  }
}

/* —— Short landscape (e.g. phone sideways) —— */
@media (max-height: 520px) and (orientation: landscape) {
  .screen {
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }

  .card {
    padding: 18px 20px 20px;
  }

  .icon-badge {
    width: 56px;
    height: 56px;
    margin-bottom: 10px;
  }

  .title {
    font-size: 1.45rem;
    margin-bottom: 8px;
  }

  .subtitle {
    margin-bottom: 14px;
    font-size: 0.9rem;
  }

  .actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .actions .btn-yes,
  .actions .btn-no {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(50% - 6px);
  }

  .wish-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }

  .wish-actions .btn-yes,
  .wish-actions .btn-ghost {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(50% - 6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }

  .icon-badge {
    animation: none;
  }

  .cake-rain-piece {
    animation: none;
    opacity: 0;
  }
}
