@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Cormorant+Garamond:wght@300;400;600&family=Cinzel+Decorative:wght@400;700&display=swap');

:root {
  --gold-1: #FFD700;
  --gold-2: #FFC200;
  --gold-3: #E8A800;
  --gold-4: #B8860B;
  --gold-light: #FFF9E6;
  --gold-pale: #FFFAED;
  --dark: #0A0700;
  --dark-2: #1A1200;
  --dark-3: #2A1F00;
  --dark-card: #120E00;
  --dark-surface: #1E1600;
  --text-gold: #FFD700;
  --text-cream: #FFF8DC;
  --text-light: #F5E6A3;
  --shadow-gold: rgba(255,215,0,0.4);
  --shadow-deep: rgba(0,0,0,0.8);
  --r: 18px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  background: var(--dark);
  color: var(--text-cream);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Animated starfield background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,180,0,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(255,140,0,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 80% 20%, rgba(255,200,0,0.06) 0%, transparent 60%),
    linear-gradient(160deg, #0A0700 0%, #1A1000 40%, #0D0900 100%);
  z-index: 0;
  pointer-events: none;
}

/* ── Glitter particles ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(255,215,0,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 60%, rgba(255,215,0,0.4) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 40% 30%, rgba(255,200,0,0.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 80%, rgba(255,215,0,0.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 70% 10%, rgba(255,215,0,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 50%, rgba(255,200,0,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 85%, rgba(255,215,0,0.5) 0%, transparent 100%),
    radial-gradient(2px 2px at 92% 70%, rgba(255,215,0,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 45%, rgba(255,220,0,0.5) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 35% 5%, rgba(255,215,0,0.4) 0%, transparent 100%);
  animation: twinkle 4s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

@keyframes twinkle {
  0%   { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1;   transform: scale(1.05); }
}

/* ── Container ── */
.container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 48px;
}

/* ── Card ── */
.birthday-card {
  width: 100%;
  max-width: 560px;
  background: linear-gradient(160deg, #1A1200 0%, #0F0B00 50%, #160F00 100%);
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(255,215,0,0.25),
    0 0 40px rgba(255,180,0,0.15),
    0 40px 80px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255,215,0,0.2);
  animation: cardEntrance 0.8s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Gold border ornament ── */
.birthday-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 1.5px;
  background: linear-gradient(135deg, #FFD700, #B8860B 30%, #FFD700 50%, #B8860B 70%, #FFD700);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 10;
  animation: borderShimmer 3s linear infinite;
}

@keyframes borderShimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ── Header Image ── */
.header-image {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.header-image::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(to top, #0F0B00 0%, transparent 100%);
}

.main-image {
  width: 100%;
  display: block;
  object-fit: cover;
  transition: transform 8s ease;
}

.birthday-card:hover .main-image { transform: scale(1.03); }

/* ── Corner ornaments ── */
.corner-ornament {
  position: absolute;
  font-size: 22px;
  z-index: 5;
  opacity: 0.7;
  animation: floatOrn 3s ease-in-out infinite alternate;
}
.corner-ornament.tl { top: 12px; left: 14px; }
.corner-ornament.tr { top: 12px; right: 14px; animation-delay: 0.5s; }

@keyframes floatOrn {
  from { transform: translateY(0) rotate(-5deg); }
  to   { transform: translateY(-4px) rotate(5deg); }
}

/* ── Divider ── */
.gold-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  margin: 4px 0;
}

.gold-divider::before,
.gold-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-3), transparent);
}

.gold-divider span {
  color: var(--gold-2);
  font-size: 16px;
  flex-shrink: 0;
}

/* ── Prayer Box ── */
.prayer-box {
  margin: 20px 24px 16px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(255,215,0,0.08), rgba(184,134,11,0.05));
  border: 1px solid rgba(255,215,0,0.18);
  border-radius: 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.prayer-box::before {
  content: '✦';
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: #0F0B00;
  padding: 0 8px;
  color: var(--gold-2);
  font-size: 18px;
}

.prayer {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: clamp(14px, 3.8vw, 17px);
  color: var(--text-light);
  line-height: 1.7;
  letter-spacing: 0.01em;
}

/* ── Winners Counter ── */
.winners-counter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0 24px;
  margin: 16px 0;
}

.counter-box {
  background: linear-gradient(160deg, rgba(255,215,0,0.1) 0%, rgba(255,150,0,0.05) 100%);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 14px;
  padding: 16px 8px;
  text-align: center;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.counter-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(255,200,0,0.2);
}

.counter-box::after {
  content: '';
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
  border-radius: 2px;
}

.counter-number {
  display: block;
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 700;
  color: var(--gold-1);
  text-shadow: 0 0 20px rgba(255,215,0,0.5), 0 0 40px rgba(255,180,0,0.3);
  line-height: 1;
  margin-bottom: 6px;
}

.counter-label {
  display: block;
  font-size: clamp(10px, 2.5vw, 12px);
  color: rgba(255,215,0,0.6);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 300;
}

/* ── Offer Section ── */
.offer-section {
  margin: 8px 24px 20px;
  text-align: center;
}

.offer-section h2 {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(16px, 4.5vw, 22px);
  color: var(--gold-1);
  text-shadow: 0 0 20px rgba(255,215,0,0.4);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.offer-section > p:first-of-type {
  font-size: clamp(13px, 3.2vw, 15px);
  color: rgba(255,240,180,0.75);
  margin-bottom: 18px;
  line-height: 1.5;
}

/* ── Alert ── */
.alert {
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.alert.success {
  background: linear-gradient(135deg, rgba(0,200,100,0.15), rgba(0,150,80,0.1));
  border: 1px solid rgba(0,200,100,0.3);
  color: #7FFFD4;
}

.alert.error {
  background: linear-gradient(135deg, rgba(255,60,60,0.15), rgba(200,0,0,0.1));
  border: 1px solid rgba(255,60,60,0.3);
  color: #FFB3B3;
}

/* ── Phone Form ── */
.phone-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.phone-form input[type="tel"] {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255,215,0,0.05);
  border: 1.5px solid rgba(255,215,0,0.25);
  border-radius: 14px;
  color: var(--text-cream);
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  letter-spacing: 0.05em;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
  -webkit-appearance: none;
}

.phone-form input::placeholder { color: rgba(255,215,0,0.35); }

.phone-form input:focus {
  border-color: rgba(255,215,0,0.7);
  background: rgba(255,215,0,0.08);
  box-shadow: 0 0 0 3px rgba(255,215,0,0.12), 0 0 20px rgba(255,180,0,0.1);
}

.phone-form button {
  width: 100%;
  padding: 17px 24px;
  background: linear-gradient(135deg, #FFD700 0%, #FFC200 40%, #E8A800 70%, #FFD700 100%);
  background-size: 200% 200%;
  border: none;
  border-radius: 14px;
  color: #1A0F00;
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(13px, 3.5vw, 16px);
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow:
    0 4px 20px rgba(255,180,0,0.4),
    0 1px 0 rgba(255,255,200,0.3) inset;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

.phone-form button::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.5s ease;
}

.phone-form button:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(255,180,0,0.5), 0 1px 0 rgba(255,255,200,0.3) inset; }
.phone-form button:hover::before { left: 200%; }
.phone-form button:active { transform: translateY(0); }

.limit-text {
  margin-top: 12px;
  font-size: 12px;
  color: rgba(255,215,0,0.45);
  letter-spacing: 0.05em;
  font-style: italic;
}

/* ── Recent Winners ── */
.recent-winners {
  margin: 0 24px 28px;
}

.recent-winners h3 {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(13px, 3.5vw, 16px);
  color: var(--gold-2);
  text-align: center;
  margin-bottom: 14px;
  letter-spacing: 0.06em;
}

.winners-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.winner-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, rgba(255,215,0,0.08), rgba(255,180,0,0.04), transparent);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: 12px;
  padding: 12px 16px;
  animation: slideIn 0.5s cubic-bezier(0.16,1,0.3,1) both;
  transition: transform 0.2s, background 0.2s;
}

.winner-item:hover {
  transform: translateX(4px);
  background: linear-gradient(90deg, rgba(255,215,0,0.13), rgba(255,180,0,0.06), transparent);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.trophy { font-size: 18px; flex-shrink: 0; }

.winner-phone {
  flex: 1;
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  color: var(--text-cream);
  letter-spacing: 0.08em;
}

.won-badge {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  color: #1A0F00;
  font-family: 'Cinzel Decorative', serif;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.1em;
  box-shadow: 0 2px 8px rgba(255,180,0,0.3);
}

/* ── OVERLAY (Already Submitted) ── */
.overlay-container {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, rgba(255,180,0,0.1), transparent 70%),
    linear-gradient(160deg, #0A0700, #1A1000);
  padding: 24px;
}

.overlay-content {
  max-width: 500px;
  width: 100%;
  background: linear-gradient(160deg, #1A1200, #0F0B00);
  border-radius: 24px;
  padding: 6px;
  box-shadow:
    0 0 0 1.5px rgba(255,215,0,0.3),
    0 0 60px rgba(255,180,0,0.2),
    0 40px 80px rgba(0,0,0,0.8);
  animation: cardEntrance 0.8s cubic-bezier(0.16,1,0.3,1) both;
}

.overlay-image {
  width: 100%;
  border-radius: 18px;
  display: block;
}

/* ── Floating particles ── */
.particle {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  font-size: 16px;
  opacity: 0;
  animation: particleFall linear infinite;
}

@keyframes particleFall {
  0%   { transform: translateY(-10vh) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.5; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* ── Responsive tweaks ── */
@media (max-width: 400px) {
  .container { padding: 16px 10px 40px; }
  .birthday-card { border-radius: 18px; }
  .prayer-box, .offer-section, .recent-winners { margin-left: 16px; margin-right: 16px; }
  .winners-counter { padding: 0 16px; gap: 8px; }
  .counter-box { padding: 12px 4px; }
}

@media (min-width: 600px) {
  .container { padding: 40px 24px 60px; }
}

/* ── Number pulse on load ── */
.counter-number {
  animation: numPulse 2s ease-in-out infinite alternate;
}

@keyframes numPulse {
  from { text-shadow: 0 0 10px rgba(255,215,0,0.4), 0 0 20px rgba(255,180,0,0.2); }
  to   { text-shadow: 0 0 20px rgba(255,215,0,0.7), 0 0 40px rgba(255,180,0,0.4), 0 0 60px rgba(255,150,0,0.2); }
}