/* =============================================
   RUEL'S CARNAVAL — COMPLETE MOBILE DESIGN SYSTEM
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Quicksand:wght@500;600;700&display=swap');

:root {
  --bg-warm:         #FDF9F0;
  --color-red:       #E63946;
  --color-blue:      #60A5FA;
  --color-blue-dark: #2563EB;
  --color-yellow:    #FBBF24;
  --color-green:     #2A9D8F;
  --color-navy:      #1E3A8A;
  --font-head: 'Fredoka', cursive, sans-serif;
  --font-body: 'Quicksand', sans-serif;
  --slide-dur: 0.42s;
  --slide-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg-warm);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

/* ── PARTICLE CANVAS ── */
#particleCanvas {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 1;
}

/* ── LAYOUT ── */
.mobile-app-container {
  position: relative;
  width: 100vw; height: 100vh;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-slider-viewport {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100%;
  overflow: hidden;        /* clips outgoing slide */
}

/* ── SLIDE PAGES ── */
.mobile-slide-page {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  /* default: hidden off-screen right */
  transform: translateX(100%);
  opacity: 0;
  transition: transform var(--slide-dur) var(--slide-ease),
              opacity  var(--slide-dur) var(--slide-ease);
  will-change: transform, opacity;
}

/* ACTIVE: center */
.mobile-slide-page.active {
  transform: translateX(0);
  opacity: 1;
}

/* OUTGOING: exit to left */
.mobile-slide-page.slide-out-left {
  transform: translateX(-100%);
  opacity: 0;
}

/* INCOMING from left (back nav) */
.mobile-slide-page.slide-from-left {
  transform: translateX(-100%);
  opacity: 0;
}

/* ENTRANCE initial pop for card */
.anim-slide-enter {
  animation: cardEntrancePop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes cardEntrancePop {
  0%   { opacity:0; transform: scale(0.88) translateY(20px); }
  65%  { transform: scale(1.025) translateY(-4px); }
  100% { opacity:1; transform: scale(1) translateY(0); }
}

/* ── CANVA CARD ── */
.canva-card-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 105 / 148; /* Match Canva original aspect ratio */
  max-height: calc(100dvh - 28px);
  overflow: hidden;
  margin: 0 auto;
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.20);
}

.canva-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── CANVA-STYLE CARD RISE ENTRANCE ── */
.mobile-slide-page.active .canva-card-wrapper {
  animation: canvaCardRise 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}
@keyframes canvaCardRise {
  0%   { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}



/* ── PLAIN BUTTON (SLIDE 2) ── */
.plain-tap-wrapper {
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
}
.plain-tap-wrapper button {
  padding: 10px 24px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  border: 2px solid #000;
  background: #fff;
  color: #000;
  white-space: nowrap;
}


/* ── CHARACTER POPUP CARD ── */
.char-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.48);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.char-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.char-modal-card {
  background: #fff;
  border: 4px solid var(--color-yellow);
  border-radius: 24px;
  padding: 28px 24px;
  text-align: center;
  width: 100%;
  max-width: 320px;
  position: relative;
  transform: scale(0.85) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
.char-modal-overlay.open .char-modal-card {
  transform: scale(1) translateY(0);
}

.char-modal-close {
  position: absolute;
  top: 12px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #F1F5F9;
  border: none;
  font-size: 14px; font-weight: 700;
  color: #64748B;
  cursor: pointer;
  line-height: 30px;
}

.char-modal-emoji {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12));
  animation: charEmojiWiggle 2s ease-in-out infinite;
}
@keyframes charEmojiWiggle {
  0%,100% { transform: rotate(-6deg) scale(1); }
  50%     { transform: rotate(6deg) scale(1.08); }
}

.char-modal-name {
  font-family: var(--font-head);
  font-size: 26px;
  color: var(--color-navy);
  margin-bottom: 2px;
}

.char-modal-role {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-blue-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.char-modal-bio {
  font-size: 14px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 16px;
}

.char-modal-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--color-yellow), #F97316);
  color: #fff;
  font-family: var(--font-head);
  font-size: 12px;
  padding: 6px 16px;
  border-radius: 20px;
}

/* ── WISHLIST (SLIDE 3) ── */
.wishlist-mobile-viewport {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 12px 10px 48px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.registry-header {
  background: #fff;
  border: 4px solid var(--color-yellow);
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.07);
}

.registry-title {
  font-family: var(--font-head);
  color: var(--color-navy);
  font-size: 23px;
  margin-bottom: 4px;
}

.registry-subtitle { font-size: 13px; color: #6B7280; }

.registry-stats {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.stat-pill {
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-navy);
}
.stat-pill.claimed { background: #FEF2F2; border-color: #FF4D4D; color: #DC2626; }

/* GIFT GRID — staggered entrance */
.gift-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gift-card {
  background: #fff;
  border: 2px solid #E2E8F0;
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  /* staggered entrance */
  opacity: 0;
  transform: translateY(20px);
  animation: cardStaggerIn 0.4s ease forwards;
}
.gift-card.is-claimed { background: #FAF5FF; border-color: #DDD6FE; }

@keyframes cardStaggerIn {
  to { opacity: 1; transform: translateY(0); }
}

.gift-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #F1F5F9;
}

.gift-carousel img { width:100%; height:100%; object-fit:contain; background:#F8FAFC; transform: scale(1.0); display:none; }
.gift-carousel img.active { display:block; }

.carousel-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: 1px solid #CBD5E1;
  color: #334155;
  font-weight: bold;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 5;
}
.carousel-btn.prev { left: 6px; }
.carousel-btn.next { right: 6px; }

.carousel-dots {
  position: absolute; bottom: 6px;
  left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px; z-index: 5;
}
.carousel-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.6); cursor: pointer;
}
.carousel-dot.active { background: #EF4444; width: 14px; border-radius: 3px; }

.gift-category { font-size: 9px; font-weight: 700; text-transform: uppercase; color: #94A3B8; letter-spacing: 0.5px; }
.gift-name { font-family: var(--font-head); font-size: 13px; color: var(--color-navy); line-height: 1.3; }

.gift-status-badge {
  display: inline-block; padding: 2px 6px;
  border-radius: 10px; font-size: 9px; font-weight: 700;
  text-align: center;
}
.gift-status-badge.available { background: #DCFCE7; color: #15803D; }
.gift-status-badge.claimed   { background: #FEE2E2; color: #B91C1C; }

.gift-actions { display: flex; flex-direction: column; gap: 6px; }

.btn-shopee {
  background: #EE4D2D; color: #fff;
  text-decoration: none;
  font-family: var(--font-head); font-size: 11px;
  padding: 8px 4px; border-radius: 8px;
  text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.btn-shopee.disabled { background: #94A3B8 !important; opacity: 0.6; pointer-events: none; }

.btn-claim {
  background: #F1F5F9; color: #334155;
  border: 1px solid #CBD5E1;
  font-family: var(--font-head); font-size: 10px;
  padding: 7px 4px; border-radius: 8px; cursor: pointer;
}
.btn-claim.unclaim { background: #FEF2F2; border-color: #FECACA; color: #DC2626; }

.buyer-note {
  background: #EFF6FF; border-left: 3px solid #3B82F6;
  padding: 6px 8px; border-radius: 6px;
  font-size: 10px; color: #1E40AF;
}

/* ── CLAIM MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  z-index: 100;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.storybook-card {
  background: #fff;
  border: 4px solid var(--color-yellow);
  border-radius: 20px;
  width: 100%; max-width: 400px;
  max-height: 85vh; overflow-y: auto;
  padding: 20px;
  position: relative;
  font-family: var(--font-body);
}

.btn-close-modal {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  background: #F1F5F9; border: none;
  font-size: 16px; font-weight: bold; color: #64748B; cursor: pointer;
}

.form-group { margin-bottom: 12px; text-align: left; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--color-navy); margin-bottom: 4px; }
.form-input, .form-textarea { width: 100%; padding: 9px 12px; border: 1px solid #CBD5E1; border-radius: 10px; font-family: var(--font-body); font-size: 13px; }
.radio-group { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.radio-label { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; cursor: pointer; }

.btn-submit { width: 100%; background: #EF4444; color: #fff; font-family: var(--font-head); font-size: 15px; padding: 11px; border: none; border-radius: 12px; cursor: pointer; margin-top: 6px; }
