:root {
  --bg-1: #1b111a;
  --bg-2: #2a1324;
  --pink: #ff5ea8;
  --pink-deep: #d73288;
  --cream: #ffd8ea;
  --gold: #ffd991;
  --text: #ffdcec;
  --ink: #120a12;
  --white: #ffffff;
  --shadow: 0 16px 40px rgba(255, 30, 140, 0.3);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, #4a1d3d 0%, transparent 35%),
    radial-gradient(circle at 80% 95%, #3b102d 0%, transparent 30%),
    linear-gradient(145deg, #10080f, #241127 48%, #1a0f1f);
  overflow: hidden;
}

.bg-decor {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 178, 218, 0.95);
  box-shadow: 0 0 12px rgba(255, 94, 168, 0.9);
  animation: drift linear infinite;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px 16px 28px;
  opacity: 0;
  transform: translateY(14px) scale(0.99);
  pointer-events: none;
  transition: opacity 420ms ease, transform 420ms ease;
}

.screen.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.card {
  width: min(100%, 420px);
  background: linear-gradient(160deg, rgba(41, 19, 39, 0.82), rgba(23, 12, 27, 0.88));
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 114, 186, 0.28);
  border-radius: 26px;
  padding: 24px 18px;
  box-shadow: var(--shadow);
}

.center-card {
  text-align: center;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin-top: 6px;
}

h2 {
  font-size: 1.55rem;
  line-height: 1.25;
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.84;
}

.subtext {
  margin-top: 12px;
  font-size: 1rem;
  line-height: 1.5;
  opacity: 0.9;
}

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

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 220ms ease, opacity 220ms ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: linear-gradient(120deg, #ff5ea8, #e33a90 55%, #b92d79);
  color: var(--white);
  box-shadow: 0 8px 24px rgba(255, 66, 160, 0.42);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.07);
  color: #ffc2de;
  border: 1px solid rgba(255, 114, 186, 0.3);
}

.btn.text-btn {
  margin: 14px auto 0;
  display: block;
  color: #ffb8d9;
  background: transparent;
  text-decoration: underline;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.memory-wrapper h2 {
  text-align: center;
}

.memory-deck {
  position: relative;
  height: 310px;
  margin-top: 14px;
}

.single-memory {
  height: 330px;
}

.memory-card {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #2f1730, #1e1122);
  border-radius: 20px;
  padding: 16px;
  border: 1px solid rgba(255, 94, 168, 0.3);
  opacity: 0;
  transform: translateX(18px) scale(0.98);
  transition: opacity 330ms ease, transform 330ms ease;
}

.memory-card.is-visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.img-placeholder {
  height: 190px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #ffc2df;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(130deg, #4e2447, #2c152f);
  border: 1px dashed rgba(255, 194, 223, 0.45);
}

.memory-card p {
  line-height: 1.45;
}

.solo-card {
  opacity: 1;
  transform: none;
}

.heart-playground {
  margin: 18px auto 0;
  width: 100%;
  min-height: 290px;
  position: relative;
  border-radius: 20px;
  background: linear-gradient(165deg, #2a152c, #1d1020);
  border: 1px solid rgba(255, 94, 168, 0.28);
}

.heart {
  position: absolute;
  width: 38px;
  height: 34px;
  border: none;
  background: transparent;
  cursor: pointer;
  transform-origin: center;
  animation: floatUpDown 2.4s ease-in-out infinite;
}

.heart::before,
.heart::after {
  content: "";
  position: absolute;
  width: 19px;
  height: 30px;
  border-radius: 19px 19px 0 0;
  background: linear-gradient(180deg, #ff79b8, #df3d8f);
}

.heart::before {
  left: 19px;
  transform: rotate(-45deg);
  transform-origin: 0 100%;
}

.heart::after {
  left: 0;
  transform: rotate(45deg);
  transform-origin: 100% 100%;
}

.heart.pop {
  animation: pop 260ms ease-out forwards;
  pointer-events: none;
}

.progress {
  margin-top: 10px;
  font-weight: 700;
  color: #ffb7da;
}

.heart-message {
  margin-top: 10px;
  min-height: 44px;
  color: #ffe0f0;
  font-weight: 700;
  line-height: 1.4;
}

.verify-list {
  margin-top: 16px;
  display: grid;
  gap: 10px;
  text-align: left;
}

.verify-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 114, 186, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.verify-item-text {
  font-size: 0.92rem;
  color: #ffd5e8;
}

.verify-item-btn {
  border: 1px solid rgba(255, 143, 199, 0.55);
  background: rgba(255, 255, 255, 0.08);
  color: #ffd8ea;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
}

.verify-item.complete {
  border-color: rgba(144, 255, 194, 0.65);
  background: rgba(89, 221, 151, 0.14);
}

.verify-item.complete .verify-item-btn {
  border-color: rgba(144, 255, 194, 0.65);
  color: #b7ffd4;
}

.scan-panel {
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 114, 186, 0.42);
  padding: 10px;
  background: rgba(8, 12, 18, 0.55);
}

.scan-viewport {
  position: relative;
  height: 110px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 116, 191, 0.25), transparent 60%),
    linear-gradient(180deg, rgba(23, 16, 33, 0.92), rgba(12, 9, 18, 0.92));
  border: 1px solid rgba(255, 116, 191, 0.35);
  overflow: hidden;
}

.scan-line {
  position: absolute;
  left: 8px;
  right: 8px;
  top: -8px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ff75be, transparent);
  box-shadow: 0 0 16px rgba(255, 117, 190, 0.95);
}

.scan-panel.scanning .scan-line {
  animation: sweep 1300ms ease-in-out infinite;
}

.scan-label {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #ffd4e9;
}

#verify-continue-btn,
#scan-btn {
  margin-top: 12px;
}

.scan-metrics {
  margin-top: 12px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 114, 186, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.scan-metrics p {
  font-size: 0.86rem;
  color: #ffd9ea;
  margin-bottom: 6px;
}

.scan-metrics p:last-child {
  margin-bottom: 0;
}

.scan-log {
  margin-top: 10px;
  text-align: left;
  min-height: 82px;
  max-height: 120px;
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 114, 186, 0.35);
  background: rgba(5, 8, 14, 0.45);
  padding: 8px 10px;
}

.scan-log p {
  margin: 0 0 6px;
  color: #f9d9ea;
  font-size: 0.82rem;
  line-height: 1.4;
}

.scan-log p:last-child {
  margin-bottom: 0;
}

.gift-box {
  margin-top: 18px;
  width: 150px;
  height: 150px;
  border: none;
  background: transparent;
  position: relative;
  cursor: pointer;
  filter: drop-shadow(0 16px 20px rgba(255, 72, 163, 0.34));
}

.gift-base {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 130px;
  height: 92px;
  border-radius: 12px;
  transform: translateX(-50%);
  background: linear-gradient(160deg, #ff8ec3, #ec4e9f);
  border: 2px solid rgba(255, 214, 237, 0.95);
}

.gift-lid {
  position: absolute;
  left: 50%;
  top: 24%;
  width: 142px;
  height: 34px;
  border-radius: 11px;
  transform: translateX(-50%);
  background: linear-gradient(145deg, #ff64ad, #d93587);
  border: 2px solid rgba(255, 214, 237, 0.95);
  transition: transform 450ms ease;
}

.gift-ribbon-v,
.gift-ribbon-h {
  position: absolute;
  background: linear-gradient(180deg, #ffe5ad, #ffc86f);
}

.gift-ribbon-v {
  left: 50%;
  top: 34%;
  width: 14px;
  height: 100px;
  transform: translateX(-50%);
  border-radius: 8px;
}

.gift-ribbon-h {
  left: 50%;
  top: 58%;
  width: 130px;
  height: 14px;
  transform: translateX(-50%);
  border-radius: 8px;
}

.gift-box.open {
  animation: glowPulse 1.4s ease-in-out 1;
}

.gift-box.open .gift-lid {
  transform: translate(-64%, -56px) rotate(-14deg);
}

.confetti {
  position: fixed;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  top: 50%;
  left: 50%;
  animation: confettiDrop 1s ease-out forwards;
  z-index: 5;
  pointer-events: none;
}

.reveal-card {
  box-shadow: 0 0 0 rgba(0, 0, 0, 0), var(--shadow);
}

.gift-code {
  margin-top: 16px;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 10px;
  border: 1px solid rgba(255, 94, 168, 0.38);
}

.gift-code.blurred {
  filter: blur(7px);
}

.gift-code.revealed {
  filter: blur(0);
  color: #ffe4b0;
  box-shadow: 0 0 28px rgba(255, 94, 168, 0.55);
  animation: glowPulse 1.1s ease;
}

.final-message {
  margin-top: 16px;
  color: #ffc5e0;
  font-weight: 800;
  animation: fadeUp 620ms ease;
}

.music-toggle {
  position: fixed;
  top: max(env(safe-area-inset-top), 8px);
  right: 10px;
  z-index: 10;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffd0e6;
  padding: 9px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(255, 114, 186, 0.34);
  box-shadow: 0 8px 18px rgba(255, 72, 163, 0.25);
}

.hidden {
  display: none !important;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatUpDown {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.03);
  }
}

@keyframes pop {
  to {
    opacity: 0;
    transform: scale(1.8) rotate(8deg);
  }
}

@keyframes glowPulse {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(255, 94, 168, 0.35));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(255, 94, 168, 0.82));
  }
}

@keyframes sweep {
  0% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(96px);
    opacity: 1;
  }
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
}

@keyframes confettiDrop {
  from {
    transform: translate(-50%, -50%) rotate(0);
    opacity: 1;
  }
  to {
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r));
    opacity: 0;
  }
}

@keyframes drift {
  from {
    transform: translateY(100vh) scale(0.9);
    opacity: 0;
  }
  20%,
  80% {
    opacity: 1;
  }
  to {
    transform: translateY(-20vh) scale(1.15);
    opacity: 0;
  }
}

@media (min-width: 480px) {
  .card {
    padding: 28px 24px;
  }

  .heart-playground {
    min-height: 320px;
  }
}
