/* ==========================================================================
   Sister's Day Mobile 60FPS Engine with Interactive Task Locks
   Created with Infinite Love by Brother Aryan
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600;700&family=Outfit:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,600;0,800;1,600&display=swap');

:root {
  --primary-rose: #ff4e88;
  --primary-pink: #ff85a2;
  --soft-pink: #ffe5ec;
  --deep-purple: #2b0938;
  --accent-gold: #ffd700;
  --gold-glow: #ffae00;
  --card-bg: rgba(36, 9, 44, 0.95);
  --glass-border: rgba(255, 255, 255, 0.18);
  --text-light: #ffffff;
  --text-dim: #f3d5ea;
  --radius-xl: 24px;
  --transition-smooth: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.35s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #14021a;
  color: var(--text-light);
  position: relative;
}

#magicCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* Top Progress Dots & Controls */
.story-header-bar {
  position: fixed;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.story-progress-dots {
  display: flex;
  gap: 3px;
  flex: 1;
  max-width: 300px;
}

.dot {
  height: 4px;
  flex: 1;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  transition: background 0.3s ease;
}

.dot.active {
  background: linear-gradient(90deg, var(--primary-rose), var(--accent-gold));
}

.top-control-btn {
  background: rgba(45, 12, 55, 0.85);
  border: 1px solid var(--glass-border);
  color: #fff;
  padding: 6px 12px;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 0.8rem;
}

.aryan-signature-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(255, 78, 136, 0.2);
  border: 1px solid var(--accent-gold);
  border-radius: 50px;
  color: var(--accent-gold);
  font-size: 0.82rem;
  font-weight: 700;
}

/* ==========================================================================
   GATEWAY LICENCE VERIFICATION MODAL
   ========================================================================== */

.gateway-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 999;
  background: rgba(9, 0, 14, 0.96);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

.gateway-card {
  background: var(--card-bg);
  border: 1.5px solid var(--glass-border);
  border-radius: 24px;
  padding: 28px 18px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  transform: translateZ(0);
}

.gateway-icon {
  font-size: 3rem;
  margin-bottom: 6px;
}

.gateway-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 6vw, 2.1rem);
  font-weight: 800;
  color: var(--accent-gold);
  margin-bottom: 6px;
}

.name-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 50px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1rem;
  text-align: center;
  outline: none;
  margin-bottom: 16px;
}

.unlock-btn {
  width: 100%;
  padding: 14px;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, var(--primary-rose) 0%, var(--accent-gold) 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.error-box {
  margin-top: 14px;
  background: rgba(255, 50, 80, 0.25);
  border: 1px solid rgba(255, 80, 100, 0.5);
  padding: 12px;
  border-radius: 14px;
  display: none;
}

.error-box.active { display: block; }

.error-text {
  color: #ffb8cd;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ==========================================================================
   FULL-SCREEN STORY STAGE & HARDWARE-ACCELERATED CARD ANIMATIONS
   ========================================================================== */

#storyStage {
  position: relative;
  z-index: 10;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 45px 12px 16px 12px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

#storyStage.visible { opacity: 1; }

.story-card {
  display: none;
  width: calc(100% - 20px);
  max-width: 420px;
  max-height: calc(100dvh - 65px);
  background: var(--card-bg);
  border: 1.5px solid var(--glass-border);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-xl);
  padding: 20px 16px;
  text-align: center;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(25px) translateZ(0);
  will-change: transform, opacity;
}

.story-card.active {
  display: flex;
  opacity: 1;
  transform: translateY(0) translateZ(0);
  z-index: 20;
  animation: mobileCardPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes mobileCardPop {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 8px 0;
  color: var(--accent-gold);
}

.story-img-box {
  width: 100%;
  height: 180px;
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid var(--accent-gold);
  margin: 8px 0;
}

.story-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.btn-card-next {
  flex: 1;
  padding: 12px 16px;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, var(--primary-rose) 0%, var(--gold-glow) 100%);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

/* MANDATORY INTERACTIVE TASK LOCK STYLES */
.btn-card-next.locked {
  opacity: 0.45;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.15) !important;
  box-shadow: none !important;
  filter: grayscale(0.9);
}

.lock-hint-text {
  font-size: 0.78rem;
  color: var(--accent-gold);
  margin-top: 4px;
  font-weight: 600;
}

.btn-card-next:active { transform: scale(0.96); }

.btn-card-prev {
  padding: 12px 14px;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
}

.milestones-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
}

.milestone-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
}

.milestone-number {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.milestone-label {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.gift-box-container {
  margin: 8px auto;
  width: 140px;
  height: 140px;
  cursor: pointer;
}

.gift-box-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.secret-letter {
  display: none;
  background: #fffcf5;
  color: #331225;
  border-radius: 16px;
  padding: 16px 12px;
  border: 2px double var(--accent-gold);
}

.secret-letter-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: #8b1e4b;
  margin-bottom: 8px;
}

.secret-letter-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: #4a2035;
  text-align: left;
  white-space: pre-line;
  margin-bottom: 10px;
}

.secret-letter-signature {
  font-family: 'Dancing Script', cursive;
  font-size: 1.5rem;
  color: #c92a62;
  text-align: right;
}

.flip-card {
  height: 145px;
  perspective: 1000px;
  cursor: pointer;
  margin-bottom: 8px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
}

.flip-card-front { background: rgba(255, 255, 255, 0.06); }
.flip-card-back {
  background: linear-gradient(135deg, rgba(255, 78, 136, 0.95), rgba(45, 8, 50, 0.95));
  transform: rotateY(180deg);
}

.quiz-option-btn {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.88rem;
  cursor: pointer;
  margin-bottom: 6px;
}

.quiz-option-btn:active { transform: scale(0.97); }

.certificate-card {
  background: #fffbf0;
  color: #2c1605;
  border: 5px double #b8860b;
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
}

.cert-header {
  font-family: 'Playfair Display', serif;
  font-size: 0.82rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #8b6508;
}

.cert-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: #4a1c03;
  margin: 3px 0;
}

.cert-recipient {
  font-family: 'Dancing Script', cursive;
  font-size: 2.1rem;
  color: #c92a62;
  border-bottom: 2px solid #d4af37;
  display: inline-block;
  padding: 0 12px 2px 12px;
  margin: 3px 0 8px 0;
}

.cert-sign {
  font-family: 'Dancing Script', cursive;
  font-size: 1.3rem;
  color: #8b1e4b;
}