@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Outfit:wght@500;700;800&family=Pacifico&family=Quicksand:wght@600;700&display=swap');

:root {
  --primary-pink: #ff6584;
  --soft-pink: #ffd3e2;
  --pastel-cream: #fff8f0;
  --accent-gold: #ffc93c;
  --soft-purple: #c7ceea;
  --mint-green: #b8f2e6;
  --text-dark: #4a3e43;
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.98);
  --shadow-pink: rgba(255, 101, 132, 0.28);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Quicksand', sans-serif;
  background: radial-gradient(circle at top left, #ffd3e2, #e8dff5 40%, #fff0f5 70%, #ffcbf2 100%);
  background-attachment: fixed;
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
  position: relative;
  overflow-x: hidden;
}

/* Background Particle Canvas */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10;
}

/* Modal Overlay for Opening Gift */
.gift-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle, rgba(255, 182, 193, 0.96) 0%, rgba(200, 182, 255, 0.96) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  backdrop-filter: blur(12px);
}

.gift-modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gift-title {
  font-family: 'Pacifico', cursive;
  font-size: 2.2rem;
  color: #ffffff;
  text-shadow: 0 4px 15px rgba(255, 71, 126, 0.5);
  margin-bottom: 25px;
  text-align: center;
}

.gift-box-3d {
  width: 140px;
  height: 140px;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gift-box-3d:hover { transform: scale(1.1) rotate(4deg); }

.gift-box-body {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ff477e, #ff70a6);
  border-radius: 20px;
  box-shadow: 0 15px 30px rgba(255, 71, 126, 0.35);
  position: relative;
}

.gift-ribbon-v {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 100%;
  background: linear-gradient(to right, #ffd166, #fffc99, #ffd166);
}

.gift-ribbon-h {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 100%;
  height: 26px;
  background: linear-gradient(to bottom, #ffd166, #fffc99, #ffd166);
}

.gift-bow {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 32px;
}

.gift-bow::before, .gift-bow::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border: 5px solid #ffd166;
  border-radius: 50% 50% 0 50%;
  top: 5px;
}

.gift-bow::before { left: 0; transform: rotate(-35deg); }
.gift-bow::after { right: 0; border-radius: 50% 50% 50% 0; transform: rotate(35deg); }

.click-hint-badge {
  margin-top: 25px;
  background: #ffffff;
  padding: 10px 22px;
  border-radius: 50px;
  font-weight: 700;
  color: #ff477e;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  animation: bounceHint 1.5s infinite;
}

@keyframes bounceHint {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Compact Glass Container Card */
.main-card {
  width: 100%;
  max-width: 720px;
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  border: 2.5px solid var(--glass-border);
  border-radius: 35px;
  box-shadow: 0 22px 55px var(--shadow-pink);
  overflow: hidden;
  position: relative;
  z-index: 5;
  padding-bottom: 15px;
}

/* Header & Avatar */
.header-hero {
  position: relative;
  text-align: center;
  padding: 20px 20px 10px 20px;
}

.avatar-container {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
  cursor: pointer;
}

.user-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  object-fit: cover;
  box-shadow: 0 8px 25px rgba(255, 101, 132, 0.35);
  transition: transform 0.3s ease;
}

.user-avatar:hover { transform: scale(1.08) rotate(3deg); }

.crown-badge {
  position: absolute;
  top: -16px;
  right: -6px;
  font-size: 2rem;
  animation: wiggle 2s infinite ease-in-out;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(15deg); }
}

.badge-tag {
  display: inline-block;
  background: linear-gradient(135deg, #ffd166, #fffc99);
  color: #6b4d00;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 1px;
  margin-bottom: 4px;
  box-shadow: 0 3px 8px rgba(255,209,102,0.4);
}

.main-title {
  font-family: 'Pacifico', cursive;
  font-size: 2.2rem;
  color: var(--primary-pink);
  margin-bottom: 2px;
  text-shadow: 2px 2px 0 #fff;
}

.sub-greeting {
  font-size: 1.05rem;
  font-weight: 700;
  color: #6c5ce7;
  margin-bottom: 12px;
}

/* Tab Navigation Buttons */
.tabs-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  margin-bottom: 12px;
}

.tab-btn {
  flex: 1;
  max-width: 190px;
  background: rgba(255, 255, 255, 0.75);
  border: 2px solid transparent;
  padding: 9px 6px;
  border-radius: 20px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.tab-btn:hover { background: #ffffff; }

.tab-btn.active {
  background: linear-gradient(135deg, #ff6584, #ff85a2);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(255, 101, 132, 0.35);
  border-color: #ffffff;
}

/* Tab Contents */
.tab-content {
  display: none;
  padding: 10px 18px;
  animation: fadeIn 0.35s ease;
}

.tab-content.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Super Cute Colourful Layered Cake & Candles Upgrade */
.cake-card {
  text-align: center;
  position: relative;
}

.cake-container {
  width: 240px;
  height: 195px;
  margin: 10px auto 20px auto;
  position: relative;
  cursor: pointer;
  perspective: 600px;
}

.cake-plate {
  width: 250px;
  height: 16px;
  background: linear-gradient(135deg, #ffffff, #fff0f5);
  border: 2px solid #ffd3e2;
  border-radius: 50%;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 10px 22px rgba(255, 101, 132, 0.2);
}

.cake-layer {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 16px 16px 10px 10px;
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.7), 0 6px 15px rgba(0,0,0,0.1);
}

.layer-4 {
  width: 200px;
  height: 48px;
  bottom: 12px;
  background: linear-gradient(135deg, #ff70a6, #ff477e);
}

.layer-3 {
  width: 160px;
  height: 42px;
  bottom: 56px;
  background: linear-gradient(135deg, #b8f2e6, #4ea8de);
}

.layer-2 {
  width: 120px;
  height: 38px;
  bottom: 95px;
  background: linear-gradient(135deg, #c8b6ff, #9b5de5);
}

.layer-1 {
  width: 85px;
  height: 35px;
  bottom: 130px;
  background: linear-gradient(135deg, #fffc99, #ffd166);
}

/* Dripping Pastel Icing Decor */
.cake-icing {
  position: absolute;
  top: 0;
  width: 100%;
  height: 12px;
  background: #ffffff;
  border-radius: 14px 14px 8px 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.strawberries-row {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
  font-size: 1.2rem;
  z-index: 4;
}

.candles-row {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 6;
}

.candle {
  width: 10px;
  height: 38px;
  border-radius: 4px;
  position: relative;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.candle:nth-child(1) { background: repeating-linear-gradient(45deg, #ff477e, #ff477e 4px, #ffffff 4px, #ffffff 8px); }
.candle:nth-child(2) { background: repeating-linear-gradient(45deg, #9b5de5, #9b5de5 4px, #ffffff 4px, #ffffff 8px); }
.candle:nth-child(3) { background: repeating-linear-gradient(45deg, #00b4d8, #00b4d8 4px, #ffffff 4px, #ffffff 8px); }

.flame {
  width: 15px;
  height: 22px;
  background: radial-gradient(ellipse at bottom, #fffa85 0%, #ff7700 65%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 15px #ffcc00, 0 0 25px #ff477e;
  animation: flicker 0.5s infinite alternate ease-in-out;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.flame.extinguished { opacity: 0; transform: translateX(-50%) scale(0.1); box-shadow: none; }

@keyframes flicker {
  0% { transform: translateX(-50%) scale(1) rotate(-3deg); }
  100% { transform: translateX(-50%) scale(1.2) rotate(3deg); }
}

/* 20 Photo Scrollable Grid Container */
.photo-grid-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px 4px 15px 4px;
}

.photo-grid-scroll::-webkit-scrollbar { width: 6px; }
.photo-grid-scroll::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.4); border-radius: 10px; }
.photo-grid-scroll::-webkit-scrollbar-thumb { background: var(--primary-pink); border-radius: 10px; }

.polaroid-item {
  background: #ffffff;
  padding: 8px 8px 12px 8px;
  border-radius: 10px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.08);
  position: relative;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.polaroid-item:hover {
  transform: scale(1.06) rotate(-1deg);
  box-shadow: 0 10px 22px rgba(255, 101, 132, 0.3);
  z-index: 3;
}

.photo-img {
  width: 100%;
  height: 105px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 6px;
}

.photo-caption {
  font-family: 'Dancing Script', cursive;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-pink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Balloon Game */
.balloons-flex {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  padding: 15px 0;
}

.balloon-item {
  width: 70px;
  height: 90px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  position: relative;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  box-shadow: inset -8px -8px 15px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, opacity 0.3s ease;
  animation: floatB 3s infinite ease-in-out alternate;
}

.balloon-item::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 18px;
  background: rgba(0,0,0,0.2);
}

.b-pink { background: linear-gradient(135deg, #ff85a2, #ff477e); }
.b-purple { background: linear-gradient(135deg, #e7c6ff, #9b5de5); }
.b-gold { background: linear-gradient(135deg, #fff3b0, #ffd166); }
.b-blue { background: linear-gradient(135deg, #bde0fe, #00b4d8); }

@keyframes floatB {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

/* Bottom Controls */
.bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px 0 18px;
  border-top: 1px solid rgba(0,0,0,0.05);
  margin-top: 8px;
}

.btn-pill {
  background: linear-gradient(135deg, #ff6584, #ff85a2);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 25px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 101, 132, 0.3);
  transition: transform 0.2s ease;
}

.btn-pill:hover { transform: scale(1.05); }

/* Lightbox Photo Zoom Modal */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(15px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-card {
  background: #ffffff;
  padding: 15px 15px 25px 15px;
  border-radius: 20px;
  max-width: 90vw;
  max-height: 85vh;
  text-align: center;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  transform: scale(0.85);
  transition: transform 0.3s ease;
  position: relative;
}

.lightbox-modal.active .lightbox-card { transform: scale(1); }

.lightbox-img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 12px;
}

.lightbox-caption {
  font-family: 'Dancing Script', cursive;
  font-size: 1.8rem;
  color: var(--primary-pink);
  font-weight: 700;
}

.lightbox-close {
  position: absolute;
  top: -15px;
  right: -15px;
  background: #ff6584;
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Modal Wish Popup */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 22px;
  max-width: 400px;
  width: 88%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

#file-input, #batch-file-input { display: none; }
