:root {
  --bg-dark: #0a0a1a;
  --bg-card: rgba(20, 20, 40, 0.95);
  --gold: #FFD700;
  --gold-dark: #B8860B;
  --teal: #00CED1;
  --purple: #9370DB;
  --pink: #FF69B4;
  --text-light: #f0f0ff;
  --text-muted: #8888aa;
}

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

body {
  font-family: 'Space Grotesk', sans-serif;
  background: var(--bg-dark);
  min-height: 100vh;
  color: var(--text-light);
  overflow-x: hidden;
}

/* Sparkle Background */
.sparkle-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  border-radius: 50%;
  animation: sparkle-float 3s ease-in-out infinite;
}

@keyframes sparkle-float {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.5);
  }
}

/* Confetti */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Loading */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative;
}

.loading-gift {
  font-size: 4rem;
  animation: loading-bounce 1s ease-in-out infinite;
}

@keyframes loading-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

/* Creator Mode */
.creator-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  position: relative;
}

.creator-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 2.5rem;
  max-width: 500px;
  width: 100%;
  position: relative;
  z-index: 10;
  border: 1px solid rgba(255, 215, 0, 0.2);
  box-shadow: 
    0 0 60px rgba(147, 112, 219, 0.2),
    0 0 100px rgba(0, 206, 209, 0.1);
  backdrop-filter: blur(10px);
}

.creator-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--gold), var(--pink), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.creator-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gold);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid rgba(255, 215, 0, 0.2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-light);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-error {
  color: #FF6B6B;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.preview-section {
  margin: 2rem 0;
  text-align: center;
}

.preview-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.preview-gift {
  display: flex;
  justify-content: center;
}

.preview-image {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 16px;
  animation: preview-float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 30px rgba(147, 112, 219, 0.5));
}

@keyframes preview-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.generate-btn {
  width: 100%;
  padding: 1.2rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #0a0a1a;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.4);
}

.share-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.share-label {
  text-align: center;
  color: var(--teal);
  margin-bottom: 1rem;
  font-weight: 500;
}

.share-url-container {
  display: flex;
  gap: 0.5rem;
}

.share-url {
  flex: 1;
  padding: 0.8rem;
  border: 2px solid rgba(0, 206, 209, 0.3);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-light);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.copy-btn {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 8px;
  background: var(--teal);
  color: #0a0a1a;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.copy-btn:hover {
  background: #00E5E8;
}

.copy-btn.copied {
  background: #4CAF50;
  color: white;
}

/* Receiver Mode */
.receiver-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
}

.unwrap-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
}

.recipient-greeting {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--gold);
  margin-bottom: 2rem;
  text-align: center;
  animation: greeting-pulse 2s ease-in-out infinite;
}

@keyframes greeting-pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

.gift-box {
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.gift-box:hover {
  transform: scale(1.02);
}

.gift-box:active {
  transform: scale(0.98);
}

.gift-box.shake {
  animation: gift-shake 0.15s ease-in-out;
}

@keyframes gift-shake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-5px) rotate(-2deg); }
  75% { transform: translateX(5px) rotate(2deg); }
}

.gift-box.unwrapping {
  animation: unwrap-sequence 2s ease-in-out forwards;
}

@keyframes unwrap-sequence {
  0% { transform: scale(1) rotate(0deg); }
  20% { transform: scale(1.1) rotate(-5deg); }
  40% { transform: scale(1.1) rotate(5deg); }
  60% { transform: scale(1.15) rotate(-3deg); }
  80% { transform: scale(1.2) rotate(3deg); }
  100% { transform: scale(0) rotate(720deg); opacity: 0; }
}

.gift-image {
  width: min(300px, 80vw);
  height: min(300px, 80vw);
  object-fit: cover;
  border-radius: 20px;
  animation: gift-float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 40px rgba(147, 112, 219, 0.6));
}

@keyframes gift-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.gift-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 120%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 215, 0, 0.2) 0%, transparent 70%);
  pointer-events: none;
  animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.tap-indicator {
  margin-top: 2rem;
  text-align: center;
}

.tap-text {
  font-size: 1.3rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  animation: tap-bounce 1s ease-in-out infinite;
}

@keyframes tap-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.progress-container {
  width: 200px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 auto 0.5rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--purple), var(--pink));
  border-radius: 4px;
  transition: width 0.2s ease;
}

.progress-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.opening-text {
  font-size: 1.5rem;
  color: var(--gold);
  margin-top: 2rem;
  animation: opening-pulse 0.5s ease-in-out infinite;
}

@keyframes opening-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Reveal */
.reveal-container {
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  animation: reveal-appear 0.6s ease-out;
}

@keyframes reveal-appear {
  0% { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}

.reveal-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 3rem 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  border: 2px solid var(--gold);
  box-shadow: 
    0 0 60px rgba(255, 215, 0, 0.3),
    0 0 100px rgba(147, 112, 219, 0.2);
}

.reveal-header {
  margin-bottom: 1.5rem;
}

.reveal-emoji {
  font-size: 4rem;
  animation: emoji-bounce 1s ease-in-out infinite;
}

@keyframes emoji-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.reveal-message {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-style: italic;
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.reveal-btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #0a0a1a;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
}

.reveal-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
}

.reveal-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: linear-gradient(to top, var(--bg-dark), transparent);
  z-index: 50;
}

.footer-divider {
  margin: 0 0.5rem;
  opacity: 0.5;
}

.footer-link {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--gold);
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .creator-card {
    padding: 1.5rem;
    border-radius: 20px;
  }
  
  .creator-title {
    font-size: 1.8rem;
  }
  
  .creator-subtitle {
    font-size: 1rem;
  }
  
  .preview-image {
    width: 120px;
    height: 120px;
  }
  
  .gift-image {
    width: min(250px, 75vw);
    height: min(250px, 75vw);
  }
  
  .reveal-card {
    padding: 2rem 1.5rem;
  }
  
  .reveal-message {
    font-size: 1.1rem;
  }
}