.card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: 38px;
  padding: 42px 28px 34px;
  position: relative;
  z-index: 10;
  text-align: center;
  border: 1px solid rgba(196, 30, 58, .09);
  box-shadow: 0 22px 80px rgba(196, 30, 58, .18), 0 2px 0 rgba(255, 255, 255, .9) inset;
  animation: cardIn .9s cubic-bezier(.34, 1.56, .64, 1) both;
  overflow: visible;
  will-change: transform, opacity;
}

/* Performance scaling for mobile */
@media (max-width: 768px) {
  .card {
    backdrop-filter: blur(12px); /* Lighter blur for mobile */
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(196, 30, 58, 0.12) !important;
  }
  .rose-emoji {
    filter: drop-shadow(0 5px 12px rgba(196, 30, 58, 0.3)) !important;
  }
  .yes-btn {
    box-shadow: 0 8px 24px rgba(196, 30, 58, 0.3) !important;
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translate3d(0, 64px, 0) scale(.84) rotate(-2deg);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.card::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border-radius: 28px;
  border: 1px solid rgba(196, 30, 58, .055);
  pointer-events: none;
}

.rose-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 8px;
}

.rose-glow {
  position: absolute;
  inset: -22px;
  background: radial-gradient(circle, rgba(196, 30, 58, .26), transparent 68%);
  border-radius: 50%;
  animation: gp 2.8s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes gp {
  0%, 100% {
    transform: scale(1);
    opacity: .55;
  }
  50% {
    transform: scale(1.22);
    opacity: 1;
  }
}

.rose-emoji {
  font-size: 76px;
  display: block;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 10px 24px rgba(196, 30, 58, .46));
  animation: sway 4.5s ease-in-out infinite;
  will-change: transform;
}

@keyframes sway {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(-8deg);
  }
  35% {
    transform: translate3d(0, -7px, 0) rotate(5deg);
  }
  70% {
    transform: translate3d(0, -3px, 0) rotate(-4deg);
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 50px;
  background: linear-gradient(135deg, #fff0f3, #fff4e8);
  border: 1px solid rgba(196, 30, 58, .13);
  color: var(--rose);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: .5px;
}

.question {
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.65;
  color: var(--dark);
  font-weight: 900;
  min-height: 132px;
  letter-spacing: -.3px;
  position: relative;
}

.question.typing::after {
  content: '|';
  color: var(--rose);
  animation: blink .75s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.grd {
  background: linear-gradient(135deg, var(--rose), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sub {
  margin-top: 14px;
  font-size: 15px;
  color: #8A5060;
  line-height: 1.9;
  padding: 14px 18px;
  border-radius: 18px;
  border: 1px dashed rgba(196, 30, 58, .18);
  background: linear-gradient(135deg, rgba(196, 30, 58, .03), rgba(201, 151, 58, .03));
  transition: opacity .45s ease, transform .45s ease;
  min-height: 60px;
}

.att {
  margin: 13px 0 5px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--rose);
  min-height: 20px;
  transition: opacity .3s, transform .3s;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 10px 0 4px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(196, 30, 58, .11);
  transition: background .3s, transform .3s;
  will-change: transform, background;
}

.dot.lit {
  background: var(--rose);
  transform: scale(1.2);
}

.btns {
  display: flex;
  gap: 11px;
  justify-content: center;
  align-items: center;
  margin-top: 17px;
}

button {
  border: none;
  cursor: pointer;
  font-family: 'Tajawal';
}

.yes-btn {
  flex: 1;
  height: 64px;
  border-radius: 21px;
  background: linear-gradient(140deg, var(--rose2), var(--rose), #9B0D22);
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 13px 34px rgba(196, 30, 58, .38), 0 2px 0 rgba(255, 255, 255, .18) inset;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
  letter-spacing: .2px;
  animation: breathingGlow 2.5s infinite alternate ease-in-out;
  will-change: transform, box-shadow;
}

@keyframes breathingGlow {
  0% { box-shadow: 0 13px 34px rgba(196, 30, 58, .38), 0 2px 0 rgba(255, 255, 255, .18) inset; }
  100% { box-shadow: 0 18px 45px rgba(196, 30, 58, .6), 0 0 15px rgba(255, 255, 255, .3) inset; }
}

.yes-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .15) 0%, transparent 55%);
}

.yes-btn:hover {
  transform: translate3d(0, -4px, 0) scale(1.03);
  box-shadow: 0 19px 42px rgba(196, 30, 58, .46);
}

.yes-btn:active {
  transform: scale(.94);
}

.no-btn {
  width: 104px;
  height: 58px;
  border-radius: 15px;
  background: #f7f1f2;
  color: #aaa;
  font-size: 17px;
  font-weight: 700;
  border: 1.5px solid #e8d5d8;
  position: relative;
  transition: left 1.4s cubic-bezier(.25, 1, .5, 1), top 1.4s cubic-bezier(.25, 1, .5, 1), background .3s, opacity .5s, transform .5s;
  will-change: left, top, opacity, transform;
}

/* Base Card inside the pocket */
#mainCard {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0) translateY(550px); /* Pushed far down inside the envelope, centered horizontally */
  z-index: 2;
  margin: 0; /* remove auto margins from old CSS */
  animation: none !important; /* Override the default .card fade in animation */
  transition: transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}
