html, body {
  overflow-x: hidden;
  width: 100%;
  overscroll-behavior-y: contain;
}

#lanyardCard {
  touch-action: none;
}

/* 1. Daftarkan font lokal */
@font-face {
  font-family: 'ZeldaFont';
  src: url('Zelda.otf') format('truetype'); /* Sesuaikan nama file .ttf kamu */
  font-weight: normal;
  font-style: normal;
}
 
/* 2. Terapkan ke tulisan HAPPY BIRTHDAY */
.hero-title {
  font-family: 'ZeldaFont', sans-serif !important;
  letter-spacing: 0.05em !important;
}

/* ================= TRANSISI TEKS & FADE STEPS ================= */
.step-content {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.6s;
  pointer-events: none;
}

.step-content.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Font utama untuk judul/hero */
.font-hero {
  font-family: 'Bebas Neue', 'Rajdhani', Impact, sans-serif;
}

body {
  font-family: 'Rajdhani', sans-serif;
}

/* Overlay pola webbing tipis di atas foto kartu */
.card-web-overlay {
  background-image:
    repeating-linear-gradient(45deg, rgba(220,38,38,0.08) 0px, rgba(220,38,38,0.08) 1px, transparent 1px, transparent 14px),
    repeating-linear-gradient(-45deg, rgba(220,38,38,0.08) 0px, rgba(220,38,38,0.08) 1px, transparent 1px, transparent 14px);
}

/* ================= ANIMASI TEKS HAPPY BIRTHDAY ================= */
/* Satu warna (palette desktop) dipakai di semua ukuran layar */
@keyframes heroShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Efek kelap-kelip: kombinasi glow + kedip brightness, tidak linear supaya kerasa "sparkle" */
@keyframes heroTwinkle {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(220, 38, 38, 0.25)) brightness(1); }
  20%      { filter: drop-shadow(0 0 14px rgba(199, 8, 12, 0.55)) brightness(1.15); }
  40%      { filter: drop-shadow(0 0 5px rgba(108, 1, 2, 0.2)) brightness(0.95); }
  60%      { filter: drop-shadow(0 0 16px rgba(220, 38, 38, 0.6)) brightness(1.2); }
  80%      { filter: drop-shadow(0 0 8px rgba(108, 1, 2, 0.3)) brightness(1); }
}

.animated-hero {
  /* PENTING: pakai background-image (longhand), JANGAN pakai shorthand "background: ...".
     Shorthand "background" me-reset background-clip ke border-box dan bikin teks
     jadi kotak solid alih-alih ke-clip jadi bentuk huruf. */
  background-image: linear-gradient(90deg, #440101, #6c0102, #c7080c, #dc2626, #c7080c, #6c0102);
  background-size: 300% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 700;
  display: inline-block;
  animation: heroShimmer 5s ease-in-out infinite, heroTwinkle 1.8s ease-in-out infinite;
}

/* Kunci ukuran tombol navigasi agar tidak pernah melar di HP */
#prevBtn, #nextBtn {
  width: auto !important;
  min-width: 0 !important;
  max-width: max-content !important;
  flex: 0 0 auto !important;
}

#stepIndicator {
  flex: 0 0 auto !important;
}

/* =====================================================================
   OVERRIDE MOBILE (<768px)
   Struktur HTML & class md:/lg:/xl: di atas dipakai apa adanya dari versi
   yang kamu suka untuk layar >=768px. Blok di bawah ini memaksa nilai-nilai
   dari versi yang kamu suka untuk layar <768px, menimpa class sm:/base
   bawaan Tailwind di HTML (pakai !important supaya pasti menang).
   ===================================================================== */
@media (max-width: 767px) {
  .home-wrap { gap: 32px !important; padding: 24px !important; max-width: 1152px !important; }

  .lanyard-wrapper { transform: scale(1) !important; }

  #lanyardCard { width: 175px !important; height: 240px !important; }
  .card-notch { width: 32px !important; height: 12px !important; }
  .card-topbar { top: 12px !important; left: 12px !important; right: 12px !important; }
  .card-brand { font-size: 9px !important; }
  .card-dot { width: 8px !important; height: 8px !important; }
  .card-footer { bottom: 1px !important; left: 12px !important; right: 12px !important; padding: 1px 7px 4px !important; }
  .card-name { font-size: 15px !important; }
  .card-status { font-size: 9px !important; margin-top: 1px !important; }

  .wish-container { max-width: 512px !important; gap: 16px !important; }
  .mission-badge { padding: 4px 14px !important; font-size: 12px !important; }
  .hero-break { display: none !important; }
  /* 2. Terapkan ke tulisan HAPPY BIRTHDAY */
.hero-title {
  font-family: 'ZeldaFont', sans-serif !important;
   font-size: clamp(34px, 10vw, 60px) !important;
    line-height: 1.1 !important;
    padding: 3px 0 !important;
    white-space: nowrap !important;
  }
  .hero-desc { font-size: 14px !important; margin-top: 1px !important; }

  .letter-header-title { font-size: 36px !important; }
  .letter-header-sub { font-size: 12px !important; margin-top: 4px !important; }
  .letter-card { max-width: 672px !important; padding: 32px !important; border-radius: 24px !important; }
  .letter-icon { top: -24px !important; left: -12px !important; width: 56px !important; height: 56px !important; border-radius: 16px !important; font-size: 24px !important; }
  .letter-text { font-size: 14px !important; padding-top: 8px !important; }
  .letter-text > p { margin-top: 16px !important; }
  .letter-text > p:first-child { margin-top: 0 !important; }

  .bottle-sub { font-size: 12px !important; margin-top: 4px !important; }
}


/* ================= SPIDER HANGING YOYO (FULL) ================= */

.spider-hanging {
  position: absolute;
  top: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

/* Posisi Horizontal Lebih ke Tengah */
.spider-left {
  left: 18%;
  animation: spiderSway 3s ease-in-out infinite alternate;
}

.spider-right {
  right: 18%;
  animation: spiderSway 3.5s ease-in-out infinite alternate 1.2s;
}

/* Tali Laba-Laba Panjang */
.spider-thread {
  width: 2px;
  height: 280px;
  background: #ffffff;
  margin-bottom: -7px;
  transform-origin: top center;
}

/* Keterkaitan Animasi Tali & Laba-Laba */
.spider-left .spider-thread {
  animation: threadYoyo 4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
}

.spider-right .spider-thread {
  animation: threadYoyo 5s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate 1.2s;
}

.spider-left .spider-svg {
  animation: spiderClimbYoyo 4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
  filter: none !important;
}

.spider-right .spider-svg {
  animation: spiderClimbYoyo 5s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate 1.2s;
  filter: none !important;
}

/* Keyframe Perpanjangan Tali (Molor-Menciut) */
@keyframes threadYoyo {
  0% { transform: scaleY(0.1); }
  60% { transform: scaleY(1.15); }
  70% { transform: scaleY(0.95); }
  75% { transform: scaleY(1); }
  100% { transform: scaleY(1); }
}

/* Keyframe Gerakan Laba-Laba Menyusuri Tali */
@keyframes spiderClimbYoyo {
  0% { transform: translateY(-250px); }
  60% { transform: translateY(40px); }
  70% { transform: translateY(-15px); }
  75% { transform: translateY(0); }
  100% { transform: translateY(0); }
}

/* Animasi Ayunan Tipis */
@keyframes spiderSway {
  0% { transform: rotate(-4deg); }
  100% { transform: rotate(4deg); }
}

/* --- ANIMASI GERAKAN KAKI MEMANJAT --- */
@keyframes legMoveAlt {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(0.98); }
}

@keyframes legMoveOpposite {
  0%, 100% { transform: translateY(-3px) scale(0.98); }
  50% { transform: translateY(0) scale(1); }
}

.spider-legs-1 {
  animation: legMoveAlt 0.25s infinite linear;
}

.spider-legs-2 {
  animation: legMoveOpposite 0.25s infinite linear;
}

/* Responsive Tampilan Layar HP */
@media (max-width: 767px) {
  .spider-left { left: 8%; }
  .spider-right { right: 8%; }
  .spider-thread { height: 60x; }
}

/* ================= SECTION 3: WISH BOTTLE (merah / hitam / silver) ================= */
#step-2 {
  --bw: clamp(100px, calc((100svh - 370px) / 2), 230px);
  --glass: rgba(255, 255, 255, 0.07);
  --edge: rgba(239, 68, 68, 0.75);
  --cork: #7f1d1d;
}

#step-2 .stage3 { position: relative; width: var(--bw); margin: 14px auto 0; }
#step-2 .bottle { position: relative; transform-origin: 50% 90%; }
#step-2 .cork {
  width: 34%; height: calc(var(--bw) * .12); margin: 0 auto;
  background: var(--cork); border: 1.5px solid #dc2626;
  border-radius: 8px 8px 4px 4px; box-shadow: inset 0 -5px 0 rgba(0,0,0,.3);
  position: relative; z-index: 2;
}
#step-2 .neck {
  width: 36%; height: calc(var(--bw) * .2); margin: -4px auto 0;
  border: 3px solid var(--edge); border-bottom: 0; border-radius: 10px 10px 0 0;
  background: var(--glass);
}
#step-2 .body {
  position: relative; width: 100%; aspect-ratio: 210 / 350; margin-top: -3px;
  border: 3px solid var(--edge); border-radius: 38% 38% 14% 14% / 22% 22% 8% 8%;
  background: var(--glass); overflow: hidden;
  box-shadow: 0 0 30px -4px rgba(220, 38, 38, .45), 0 18px 30px -12px rgba(0,0,0,.7), inset 12px 0 18px rgba(255,255,255,.08);
}
#step-2 .body::after {
  content: ""; position: absolute; left: 9%; top: 12%; width: 7%; height: 48%;
  border-radius: 20px; background: rgba(255,255,255,.22); pointer-events: none;
}
#step-2 .item {
  position: absolute; width: max(26px, calc(var(--bw) * .23)); height: max(26px, calc(var(--bw) * .23));
  border: 0; border-radius: 9px; padding: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--c);
  box-shadow: inset 0 3px 0 rgba(255,255,255,.4), inset 0 -5px 0 rgba(0,0,0,.2), inset 3px 0 0 rgba(255,255,255,.15), 0 4px 0 rgba(0,0,0,.45);
  transition: left .22s ease, top .22s ease, transform .22s ease, opacity .3s, filter .3s;
}
#step-2 .item:hover { transform: scale(1.15) rotate(var(--r, 0deg)); z-index: 3; }
#step-2 .item svg { width: 64%; height: 64%; display: block; pointer-events: none; }
#step-2 .item.read { opacity: .45; filter: saturate(.4); }
#step-2 .item.pick { animation: wishPick .6s ease; z-index: 4; }
@keyframes wishPick { 50% { transform: scale(1.5) rotate(10deg); } }
#step-2 .shaking { animation: wishShake .12s linear infinite; }
@keyframes wishShake {
  0% { transform: translate(0,0) rotate(0); }
  25% { transform: translate(-9px,-4px) rotate(-6deg); }
  50% { transform: translate(7px,3px) rotate(5deg); }
  75% { transform: translate(-6px,-3px) rotate(-4deg); }
  100% { transform: translate(0,0) rotate(0); }
}

.btn3 {
  font-family: 'Bebas Neue', 'Rajdhani', sans-serif; font-size: 1.5rem; letter-spacing: .12em;
  color: #fff; background: #dc2626; border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px; padding: 8px 30px; cursor: pointer;
  box-shadow: 0 5px 0 #7f1d1d, 0 0 18px rgba(220,38,38,.35);
}
#step-2 .btn3 { margin-top: 18px; }
.btn3:active { transform: translateY(3px); box-shadow: 0 2px 0 #7f1d1d; }
.btn3:disabled { opacity: .6; cursor: wait; }
.btn3:focus-visible, #step-2 .item:focus-visible, .wish-close:focus-visible { outline: 3px solid #fca5a5; outline-offset: 3px; }
#step-2 .count3 { margin-top: 10px; color: #f87171; font-weight: 700; letter-spacing: .15em; font-size: 1rem; }

/* Modal pesan */
.wish-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px; z-index: 60;
}
.wish-overlay.open { display: flex; }
.wish-modal {
  position: relative; width: min(380px, 100%); text-align: center;
  background: #12121a; color: #e5e7eb; border: 1px solid rgba(220,38,38,.5);
  border-radius: 22px; padding: 30px 26px 26px;
  box-shadow: 0 24px 60px rgba(0,0,0,.7), 0 0 40px -6px rgba(220,38,38,.4);
  animation: wishRise .3s ease;
}
@keyframes wishRise { from { transform: translateY(24px) scale(.94); opacity: 0; } }
.wish-emoji {
  width: 64px; height: 64px; border-radius: 18px; background: var(--c); display: grid; place-items: center; margin: 0 auto 14px;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.4), inset 0 -5px 0 rgba(0,0,0,.2), 0 4px 0 rgba(0,0,0,.5);
}
.wish-emoji svg { width: 44px; height: 44px; }
.wish-modal h3 { font-family: 'Bebas Neue', sans-serif; font-weight: 400; letter-spacing: .12em; font-size: 1.9rem; color: #ef4444; margin-bottom: 8px; }
.wish-modal p { margin-bottom: 20px; line-height: 1.5; color: #d4d4d8; font-size: 1.15rem; font-weight: 600; }
.wish-close { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 28px; color: #ef4444; cursor: pointer; line-height: 1; }

@media (prefers-reduced-motion: reduce) {
  #step-2 .shaking, #step-2 .item.pick, .wish-modal { animation: none; }
  #step-2 .item { transition: none; }
}
