:root {
  --primary-pink: #ff4b7a;
  --soft-pink: #fce4ec;
  --gold: #ffd700;
  --deep-purple: #2b1331;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background: url('soft_bg.png') no-repeat center center;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 40px 30px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  text-align: center;
  color: white;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

h1 {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

p {
  font-size: 1rem;
  margin-bottom: 25px;
}

.intro-title {
  color: #ff1a1a;
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8), 0 0 10px rgba(255, 0, 0, 0.3);
  font-weight: 800;
}

.intro-subtitle {
  color: #ff1a1a;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.input-group {
  display: flex;
  gap: 10px;
  background: rgba(255,255,255,0.2);
  padding: 5px;
  border-radius: 50px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

input[type="text"] {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 20px;
  color: #ff1a1a;
  font-weight: 600;
  font-size: 1rem;
  outline: none;
}

input[type="text"]::placeholder {
  color: rgba(255, 26, 26, 0.6);
}

.heart-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--primary-pink);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(255, 75, 122, 0.4);
  transition: transform 0.2s;
}

.heart-btn:active {
  transform: scale(0.9);
}

.error-msg {
  height: 20px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: #ffcdd2;
  font-weight: bold;
}

.hidden {
  display: none !important;
}

/* Gift Animation */
.gift-container {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  perspective: 1000px;
}

.gift-box {
  width: 120px;
  height: 100px;
  position: relative;
  transform-style: preserve-3d;
  cursor: pointer;
}

.box-body {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 80%;
  background: linear-gradient(135deg, #ff416c, #ff4b2b);
  border-radius: 5px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.box-lid {
  position: absolute;
  top: 0;
  width: 110%;
  left: -5%;
  height: 25px;
  background: linear-gradient(135deg, #7b4397, #dc2430);
  border-radius: 5px;
  z-index: 2;
  transform-origin: bottom left;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.gift-box.open .box-lid {
  transform: rotateZ(-110deg) translateY(-20px);
}

.rose-reveal {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: 80px;
  opacity: 0;
  transition: all 0.8s 0.3s ease-out;
}

.gift-box.open .rose-reveal {
  opacity: 1;
  transform: translateX(-50%) translateY(-60px) scale(1.4);
}

#roseImg {
  width: 100%;
  filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3));
}

.message-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s 1s ease-out;
}

.message-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.message-reveal h2, 
.message-reveal p {
  color: #ff1a1a;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
  font-weight: 700;
}

.note-btn {
  background: var(--gold);
  color: #5d4037;
  border: none;
  padding: 12px 25px;
  border-radius: 50px;
  font-weight: bold;
  font-size: 1rem;
  margin-top: 15px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

/* Note Overlay */
.note-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(5px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.note-paper {
  background: #fffdf2;
  background-image: radial-gradient(#ffcdd2 10%, transparent 10%);
  background-size: 30px 30px;
  width: 100%;
  max-width: 340px;
  padding: 30px;
  border-radius: 20px;
  position: relative;
  box-shadow: 0 15px 40px rgba(0,0,0,0.5), inset 0 0 0 10px white;
  color: #444;
  transform: scale(0.8) rotate(-2deg);
  animation: unfoldNote 0.5s forwards ease-out;
  border: 2px solid #ff4b7a;
}

.note-paper::before, .note-paper::after {
  content: '❤️';
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.3;
}

.note-paper::before { top: 15px; left: 15px; }
.note-paper::after { bottom: 15px; right: 15px; }

@keyframes unfoldNote {
  to { transform: scale(1) rotate(0deg); }
}

.note-content h3 {
  color: var(--primary-pink);
  margin-top: 0;
}

.note-content p {
  color: #555;
  line-height: 1.6;
  margin-bottom: 15px;
}

.signature {
  text-align: right;
  font-style: italic;
  font-weight: bold;
}

.note-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.close-note {
  background: #f5f5f5;
  border: 1px solid #ddd;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  color: #777;
  font-size: 0.9rem;
}

.restart-btn {
  background: var(--primary-pink);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(255, 75, 122, 0.3);
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
}