:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: #090711;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 34%, rgba(112, 70, 170, .18), transparent 28rem),
    linear-gradient(155deg, #100d1d 0%, #090711 68%, #06050b 100%);
}

button { font: inherit; }

.card, .screen {
  width: 100%;
  min-height: 100svh;
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gift-screen { padding: max(2rem, env(safe-area-inset-top)) 1.25rem max(2rem, env(safe-area-inset-bottom)); }

h1 {
  position: absolute;
  top: 8svh;
  width: calc(100% - 2rem);
  margin: 0;
  color: #f8f5ff;
  font-size: clamp(1.8rem, 7vw, 3.2rem);
  line-height: 1.1;
  text-align: center;
  text-shadow: 0 6px 30px rgba(181, 137, 255, .22);
}

.gift-button {
  display: flex;
  width: min(78vw, 23rem);
  min-height: 20rem;
  margin-top: 4rem;
  padding: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #fff;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: breathe 3s ease-in-out infinite;
}

.gift {
  position: relative;
  width: min(58vw, 15rem);
  height: min(58vw, 15rem);
  margin-bottom: 1.8rem;
  filter: drop-shadow(0 1.8rem 2.2rem rgba(0, 0, 0, .48));
}

.lid {
  position: absolute;
  z-index: 4;
  top: 23%;
  left: 2%;
  width: 96%;
  height: 18%;
  border-radius: .55rem;
  background: linear-gradient(135deg, #db7ca4, #8d355f);
  box-shadow: inset 0 2px 8px rgba(255,255,255,.18);
}

.box {
  position: absolute;
  z-index: 2;
  bottom: 4%;
  left: 8%;
  width: 84%;
  height: 58%;
  border-radius: .35rem .35rem 1rem 1rem;
  background: linear-gradient(135deg, #bd5d88, #72294c);
}

.ribbon-horizontal {
  position: absolute;
  z-index: 5;
  left: 44%;
  bottom: 4%;
  width: 12%;
  height: 58%;
  background: linear-gradient(90deg, #f0c66a, #ffe7a1 55%, #ba8b35);
}

.ribbon-vertical {
  position: absolute;
  z-index: 6;
  left: 2%;
  top: 23%;
  width: 96%;
  height: 18%;
  background: linear-gradient(90deg, transparent 44%, #e9bd61 44%, #ffe6a0 56%, transparent 56%);
}

.bow {
  position: absolute;
  z-index: 7;
  top: 2%;
  width: 31%;
  height: 25%;
  border: .65rem solid #f3cf82;
  background: rgba(230, 173, 71, .12);
}

.bow-left {
  left: 21%;
  border-radius: 70% 38% 55% 42%;
  transform: rotate(18deg);
}

.bow-right {
  right: 20%;
  border-radius: 38% 70% 42% 55%;
  transform: rotate(-18deg);
}

.open-label {
  font-size: clamp(1.15rem, 5vw, 1.5rem);
  font-weight: 700;
  letter-spacing: .02em;
  text-shadow: 0 3px 18px rgba(0,0,0,.6);
}

.gift-button:focus-visible,
.retry-button:focus-visible,
.replay-button:focus-visible {
  outline: 3px solid #ffe6a0;
  outline-offset: 6px;
  border-radius: 1rem;
}

@keyframes breathe {
  0%, 100% { transform: translateY(0) rotate(-.5deg); filter: drop-shadow(0 0 0 rgba(230,190,255,0)); }
  50% { transform: translateY(-.45rem) rotate(.5deg); filter: drop-shadow(0 0 1.2rem rgba(230,190,255,.12)); }
}

.video-screen { background: #000; }

#birthday-video {
  display: block;
  width: 100%;
  height: 100svh;
  object-fit: contain;
  background: #000;
}

.retry-button,
.replay-button {
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.09);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.retry-button {
  position: absolute;
  z-index: 3;
  padding: .85rem 1.1rem;
  font-weight: 700;
}

.ending-screen {
  gap: 2.2rem;
  padding: max(2rem, env(safe-area-inset-top)) 1.25rem max(2rem, env(safe-area-inset-bottom));
  text-align: center;
}

.ending-copy p {
  margin: 0;
  color: #fff;
  font-size: clamp(1.55rem, 7vw, 3rem);
  font-weight: 700;
  line-height: 1.25;
}

.ending-copy .signature {
  margin-top: .8rem;
  color: #dcd3eb;
  font-size: clamp(1.15rem, 5vw, 1.75rem);
  font-weight: 500;
}

.replay-button {
  padding: .75rem 1.15rem;
  color: #eee9f5;
  font-size: 1rem;
}

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .gift-button { animation: none; }
}
