/* =====================================================================
   TAMAN SAKINAH — tema pernikahan muslim di taman charbagh tepi telaga:
   hijau zamrud, emas, gading marmer, langit senja keemasan & biru malam.
   Semua animasi hias memakai transform/opacity saja supaya ringan di HP.
   ===================================================================== */
:root {
  --sky-1: #1f4a5c;   /* langit senja (atas): biru kehijauan */
  --sky-2: #f3c98c;   /* langit keemasan dekat cakrawala */
  --blush: #fff4e0;
  --peach: #fdebd0;
  --sea-1: #3f8a8a;   /* telaga dekat cakrawala */
  --sea-2: #245f5f;   /* telaga hijau zamrud */
  --ink: #123f33;     /* hijau zamrud tua */
  --ink-soft: #4d6b5f;
  --gold: #d4a24c;
  --gold-2: #f3d58e;
  --rose: #1f7a5f;    /* aksen utama (tombol aktif): zamrud */
  --rose-2: #6cc3a4;  /* aksen muda */
  --maroon: #8b2635;
  --panel: rgba(16, 52, 45, 0.93);
  --panel-solid: #12382f;
  --glass: rgba(255, 251, 242, 0.78);
  --glass-dark: rgba(14, 48, 42, 0.66);
  --line: rgba(243, 213, 142, 0.6);
  --shadow: 0 10px 30px rgba(10, 36, 30, 0.28);
  --script: 'Great Vibes', cursive;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --arabic: 'Amiri', 'Noto Naskh Arabic', 'Traditional Arabic', serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-1) 0%, #c98f6e 38%, var(--sky-2) 52%, var(--sea-1) 56%, var(--sea-2) 100%);
  font-family: 'Poppins', sans-serif;
  color: #f7f3ea;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}

button {
  font-family: inherit;
}

#errorBanner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: #c0392b;
  color: #fff;
  padding: 10px 14px;
  font-size: 11px;
  word-break: break-word;
  line-height: 1.5;
}

/* =====================================================================
   SENJA DI TELAGA (layar pembuka & loading)
   Matahari keemasan tenggelam di balik kubah Masjid Terapung di cakrawala,
   jejak cahayanya berkilau di telaga, bintang & bulan sabit mulai tampak,
   pohon kurma membingkai sisi layar, lentera Maroko bergantung & berayun dari
   atas, kelopak melati berguguran. Lapisan cakrawala, masjid & kurma bergeser
   pelan mengikuti jari / mouse (paralaks, --px/--py diisi script.js).
   ===================================================================== */
#skyBackdrop {
  --px: 0;
  --py: 0;
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, #16384a 0%, #2d5a68 16%, #8f7a84 34%, #e0a67e 46%, #f6d49a 55%);
  transition: opacity 0.8s ease;
}

#skyBackdrop.hide {
  opacity: 0;
}

/* bintang pertama di langit senja */
#skyBackdrop .stars i {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff8e0;
  box-shadow: 0 0 6px 1px rgba(255, 244, 210, 0.8);
  animation: twinkle 3.4s ease-in-out infinite;
}

#skyBackdrop .stars i:nth-child(1) { left: 12%; top: 7%; }
#skyBackdrop .stars i:nth-child(2) { left: 30%; top: 14%; animation-delay: 0.7s; }
#skyBackdrop .stars i:nth-child(3) { left: 46%; top: 5%; animation-delay: 1.4s; }
#skyBackdrop .stars i:nth-child(4) { left: 62%; top: 11%; animation-delay: 2.1s; }
#skyBackdrop .stars i:nth-child(5) { left: 84%; top: 18%; animation-delay: 0.3s; }
#skyBackdrop .stars i:nth-child(6) { left: 92%; top: 6%; animation-delay: 1.9s; }
#skyBackdrop .stars i:nth-child(7) { left: 22%; top: 24%; animation-delay: 2.6s; width: 2px; height: 2px; }
#skyBackdrop .stars i:nth-child(8) { left: 74%; top: 26%; animation-delay: 1.1s; width: 2px; height: 2px; }

/* bulan sabit tipis di langit kanan atas */
#skyBackdrop .crescent {
  position: absolute;
  right: 16%;
  top: 9%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  box-shadow: -7px 4px 0 0 #fff3cf;
  transform: rotate(-20deg);
  filter: drop-shadow(0 0 8px rgba(255, 238, 190, 0.7));
}

#skyBackdrop .sun {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 190px;
  height: 190px;
  margin: -95px 0 0 -95px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffbea 0%, #ffe9b0 26%, rgba(255, 200, 120, 0.75) 46%, rgba(255, 180, 110, 0) 70%);
  animation: sunPulse 6s ease-in-out infinite;
}

@keyframes sunPulse {
  50% { transform: scale(1.1); opacity: 0.88; }
}

/* perbukitan pasir di cakrawala (SVG) */
#skyBackdrop .hills {
  position: absolute;
  left: -6%;
  width: 112%;
  bottom: 44%;
  height: 14vh;
  display: block;
  transform: translate3d(calc(var(--px) * -8px), calc(var(--py) * -3px), 0);
  transition: transform 0.6s ease-out;
}

/* Masjid Terapung di cakrawala: siluet senja berjendela keemasan, bayangannya bergoyang di telaga */
#skyBackdrop .mosque {
  position: absolute;
  left: 50%;
  bottom: 44%;
  z-index: 1; /* di atas telaga supaya bayangannya terlihat */
  width: min(112vw, 520px);
  aspect-ratio: 400 / 208;
  margin-left: calc(min(112vw, 520px) / -2);
  color: #3a3552;
  transform: translate3d(calc(var(--px) * -14px), calc(var(--py) * -4px), 0);
  transition: transform 0.6s ease-out;
}

#skyBackdrop .mosque svg {
  display: block;
  width: 100%;
  height: 100%;
}

#skyBackdrop .mosque .m .win,
#skyBackdrop .mosque .m {
  filter: drop-shadow(0 0 6px rgba(255, 210, 122, 0.35));
}

#skyBackdrop .mosque .refl {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0.22;
  transform: scaleY(-0.6);
  transform-origin: 50% 100%; /* dicerminkan terhadap garis air (tepi bawah masjid) */
  animation: reflWobble 3.4s ease-in-out infinite;
}

@keyframes reflWobble {
  50% { transform: scaleY(-0.6) scaleX(1.04); opacity: 0.14; }
}

#skyBackdrop .sea {
  position: absolute;
  left: 0;
  right: 0;
  top: 56%;
  bottom: 0;
  background: linear-gradient(180deg, #c99a86 0%, #6f9296 16%, #3f8583 48%, #245f5f 100%);
  box-shadow: inset 0 2px 0 rgba(255, 240, 210, 0.85);
}

/* jejak cahaya matahari: garis-garis keemasan yang berkilau di permukaan telaga */
#skyBackdrop .sun-path {
  position: absolute;
  left: 50%;
  top: 0;
  width: 170px;
  height: 62%;
  margin-left: -85px;
  background: repeating-linear-gradient(180deg, rgba(255, 228, 170, 0.85) 0 3px, transparent 3px 11px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 100%), radial-gradient(ellipse 50% 100% at 50% 0, #000 40%, transparent 72%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 100%), radial-gradient(ellipse 50% 100% at 50% 0, #000 40%, transparent 72%);
  mask-composite: intersect;
  animation: glint 2.4s ease-in-out infinite;
}

@keyframes glint {
  50% { opacity: 0.5; }
}

/* riak tenang: garis putus-putus putih yang bergeser pelan (makin dekat makin besar) */
#skyBackdrop .swell {
  position: absolute;
  left: -60px;
  right: -60px;
  height: 2px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.42) 0 14px, transparent 14px 56px);
  animation: swell 11s linear infinite;
}

#skyBackdrop .s1 { top: 16%; opacity: 0.55; }
#skyBackdrop .s2 { top: 40%; animation-duration: 9s; animation-direction: reverse; height: 3px; }
#skyBackdrop .s3 { top: 68%; animation-duration: 7s; height: 3px; opacity: 0.8; }
#skyBackdrop .s4 { top: 88%; animation-duration: 8s; animation-direction: reverse; height: 4px; opacity: 0.7; }

@keyframes swell {
  to { transform: translateX(56px); }
}

/* burung kuntul: dua sayap melengkung, mengepak pelan sambil melintas */
#skyBackdrop .gull {
  position: absolute;
  left: 0;
  width: 26px;
  height: 9px;
  will-change: transform;
  animation: fly 30s linear infinite;
}

#skyBackdrop .gull::before,
#skyBackdrop .gull::after {
  content: '';
  position: absolute;
  top: 0;
  width: 13px;
  height: 9px;
  border-top: 2px solid rgba(40, 50, 70, 0.6);
  border-radius: 50% 50% 0 0;
  animation: flap 1.3s ease-in-out infinite;
}

#skyBackdrop .gull::before { left: 0; transform-origin: right bottom; }
#skyBackdrop .gull::after { right: 0; transform-origin: left bottom; }
#skyBackdrop .g1 { top: 30%; animation-delay: -6s; }
#skyBackdrop .g2 { top: 36%; width: 18px; height: 7px; animation-duration: 38s; animation-delay: -20s; }

@keyframes fly {
  from { transform: translateX(-40px); }
  to { transform: translateX(calc(100vw + 40px)); }
}

@keyframes flap {
  50% { transform: scaleY(0.4); }
}

#skyBackdrop .sparkles i {
  position: absolute;
  width: 5px;
  height: 5px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px 3px rgba(255, 236, 190, 0.85);
  animation: twinkle 3s ease-in-out infinite;
}

#skyBackdrop .sparkles i:nth-child(1) { left: 20%; top: 64%; animation-delay: 0s; }
#skyBackdrop .sparkles i:nth-child(2) { left: 72%; top: 70%; animation-delay: 0.8s; }
#skyBackdrop .sparkles i:nth-child(3) { left: 86%; top: 84%; animation-delay: 1.6s; }
#skyBackdrop .sparkles i:nth-child(4) { left: 10%; top: 88%; animation-delay: 2.1s; }
#skyBackdrop .sparkles i:nth-child(5) { left: 44%; top: 62%; animation-delay: 1.2s; }
#skyBackdrop .sparkles i:nth-child(6) { left: 58%; top: 92%; animation-delay: 0.4s; }

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  50% { opacity: 1; transform: scale(1); }
}

/* pohon kurma berupa siluet di tepi telaga, membingkai sisi kiri & kanan layar */
#skyBackdrop .palm {
  position: absolute;
  z-index: 2;
  bottom: 43.6%;
  width: min(34vw, 170px);
  aspect-ratio: 120 / 160;
  color: #1c3a34;
  transform-origin: 50% 100%;
  animation: palmSway 8s ease-in-out infinite;
}

#skyBackdrop .pl1 { left: -6%; }
#skyBackdrop .pl2 { left: 10%; width: min(22vw, 110px); color: #29473f; animation-delay: -3s; }
#skyBackdrop .pr1 { right: -5%; width: min(30vw, 150px); animation-delay: -5s; }

@keyframes palmSway {
  0%, 100% { transform: translate3d(calc(var(--px) * -20px), 0, 0) rotate(0deg); }
  50% { transform: translate3d(calc(var(--px) * -20px), 0, 0) rotate(1.6deg); }
}

/* lentera Maroko bergantung pada rantai dari tepi atas, berayun pelan dari pangkalnya */
#skyBackdrop .lamp {
  position: absolute;
  z-index: 3;
  top: 0;
  left: var(--l);
  width: 40px;
  height: calc(84px + var(--len));
  transform-origin: 50% 0;
  animation: lampSway var(--d) ease-in-out infinite;
  animation-delay: var(--t);
}

#skyBackdrop .lamp::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 1.4px;
  height: var(--len);
  margin-left: -0.7px;
  background: #8a6a3a;
}

#skyBackdrop .lamp svg {
  position: absolute;
  left: 0;
  top: var(--len);
  width: 40px;
  height: 84px;
  filter: drop-shadow(0 0 14px rgba(255, 200, 110, 0.75));
}

@keyframes lampSway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

/* kelopak melati berguguran: tiap kelopak turun sambil melayang ke samping & berputar */
#skyBackdrop .petals i,
.petal-pop {
  position: absolute;
  width: 10px;
  height: 9px;
  border-radius: 60% 60% 55% 55% / 70% 70% 40% 40%;
  background: linear-gradient(160deg, #ffffff 0%, #fbeee4 100%);
  box-shadow: inset -1px -1px 0 rgba(200, 160, 140, 0.35), 0 0 4px rgba(255, 255, 255, 0.4);
}

#skyBackdrop .petals i {
  top: -20px;
  left: var(--x);
  opacity: 0.95;
  animation: petalFall var(--d) linear infinite;
  animation-delay: var(--t);
}

@keyframes petalFall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  25% { transform: translate3d(28px, 26vh, 0) rotate(120deg); }
  50% { transform: translate3d(-8px, 52vh, 0) rotate(250deg); }
  75% { transform: translate3d(34px, 78vh, 0) rotate(380deg); }
  100% { transform: translate3d(8px, 108vh, 0) rotate(520deg); }
}

/* kelopak yang memercik dari titik sentuhan jari di layar pembuka (dibuat script.js, dihapus setelah animasinya selesai) */
.petal-pop {
  position: fixed;
  z-index: 70;
  pointer-events: none;
  animation: petalPop 1.1s cubic-bezier(.2, .7, .4, 1) forwards;
}

@keyframes petalPop {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg) scale(0.6); }
  60% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--r)) scale(1.1); }
}

/* =====================================================================
   LAYAR PEMBUKA
   ===================================================================== */
.screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  text-align: center;
  overflow-y: auto;
}

/* kartu undangan: kertas gading berkilau lembut, berbingkai emas dengan lengkung runcing di puncaknya */
.intro-card {
  position: relative;
  width: min(92vw, 400px);
  padding: 30px 22px 20px;
  border-radius: 200px 200px 24px 24px / 60px 60px 24px 24px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(243, 213, 142, 0.35), transparent 60%),
    var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ink);
}

.intro-card::before {
  /* bingkai emas tipis di dalam kartu, mengikuti lengkungnya */
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 190px 190px 18px 18px / 54px 54px 18px 18px;
  border: 1px solid var(--line);
  pointer-events: none;
}

.intro-card::after {
  /* pita motif bintang di kaki kartu */
  content: '';
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 12px;
  height: 6px;
  pointer-events: none;
  opacity: 0.55;
  background:
    radial-gradient(circle, var(--gold) 0 1.6px, transparent 2px) 0 50% / 14px 6px repeat-x;
}

/* lambang bintang delapan di pucuk kartu: berputar sangat pelan */
.crest {
  position: absolute;
  left: 50%;
  top: -24px;
  width: 48px;
  height: 48px;
  margin-left: -24px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffdf6 0 55%, #f7ecd2 56% 100%);
  border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(31, 107, 84, 0.3);
}

.crest svg {
  display: block;
  width: 100%;
  height: 100%;
  padding: 7px;
  animation: crestSpin 30s linear infinite;
}

@keyframes crestSpin {
  to { transform: rotate(360deg); }
}

.intro-card>*:not(.crest) {
  opacity: 0;
  animation: riseIn 0.8s cubic-bezier(.2, .8, .2, 1) forwards;
}

.intro-card>*:nth-child(2) { animation-delay: 0.15s; }
.intro-card>*:nth-child(3) { animation-delay: 0.3s; }
.intro-card>*:nth-child(4) { animation-delay: 0.45s; }
.intro-card>*:nth-child(5) { animation-delay: 0.6s; }
.intro-card>*:nth-child(6) { animation-delay: 0.75s; }
.intro-card>*:nth-child(7) { animation-delay: 0.9s; }
.intro-card>*:nth-child(8) { animation-delay: 1.05s; }
.intro-card>*:nth-child(9) { animation-delay: 1.2s; }
.intro-card>*:nth-child(10) { animation-delay: 1.35s; }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* basmalah di atas nama pengantin */
.bismillah {
  margin: 8px 0 6px;
  font-family: var(--arabic);
  font-size: 21px;
  line-height: 1.6;
  color: #9a7224;
}

.kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #3f7d68;
}

.script-title,
#intro .names {
  margin: 4px 0 2px;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(40px, 11vw, 58px);
  line-height: 1.15;
  color: var(--ink);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
}

#intro .names .amp {
  color: #b8862c;
}

.intro-date {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.intro-date:empty {
  display: none;
}

/* nama tamu dari link personal (?to=...) */
#introGuest {
  display: none;
  margin: 2px auto 14px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px dashed rgba(31, 122, 95, 0.45);
}

#introGuest .guest-salam {
  margin-bottom: 4px;
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  font-weight: 600;
  color: #1f6b54;
}

#introGuest .guest-label {
  font-size: 11px;
  color: var(--ink-soft);
}

#introGuest .guest-name {
  margin: 3px 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

#introGuest .guest-note {
  font-size: 9px;
  font-style: italic;
  color: var(--ink-soft);
  opacity: 0.8;
}

#nameInput,
#slugInput {
  display: block;
  width: 100%;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(31, 122, 95, 0.3);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#nameInput:focus,
#slugInput:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 162, 76, 0.28);
}

.cta {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 14px 20px;
  border: 1px solid rgba(243, 213, 142, 0.9);
  border-radius: 999px;
  background: linear-gradient(135deg, #2f8f73 0%, #1f6b54 55%, #134a3b 100%);
  color: #fff8e6;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(19, 74, 59, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.3s ease;
}

.cta::after {
  /* kilau emas yang menyapu tombol */
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 226, 150, 0.55), transparent);
  transform: translateX(-150%) skewX(-20deg);
  animation: shine 3.2s ease-in-out infinite 1.4s;
}

@keyframes shine {
  0% { transform: translateX(-150%) skewX(-20deg); }
  45%, 100% { transform: translateX(325%) skewX(-20deg); }
}

.cta:active {
  transform: scale(0.97);
  box-shadow: 0 4px 12px rgba(19, 74, 59, 0.35);
}

.cta.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.intro-card .hint {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-soft);
}

#slugPrompt .hint {
  margin: 8px 0 14px;
}

#mpWarning {
  display: none;
  margin-top: 8px;
  font-size: 10px;
  color: #c0392b;
}

/* pelaminan mini di atas taman bundar berbingkai pasir, di tengah telaga, mengayun pelan di atas kartu undangan */
.intro-hero {
  position: relative;
  flex-shrink: 0;
  width: min(64vw, 290px, 34vh);
  margin-bottom: 18px;
  z-index: 1;
  animation: heroFloat 5s ease-in-out infinite, riseIn 1s ease both;
}

@keyframes heroFloat {
  50% { transform: translateY(-5px); }
}

.intro-hero .hero-glow {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 150%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 250, 230, 0.85) 0%, rgba(255, 226, 160, 0.45) 35%, rgba(255, 255, 255, 0) 65%);
  animation: sunPulse 5s ease-in-out infinite;
}

/* taman mini: gambar pelaminan (rasio ~7:6) di atas rumput bertabur melati, dibingkai pasir & air pirus */
.hero-isle {
  position: relative;
  padding-bottom: 12%;
}

.hero-isle img {
  position: relative;
  z-index: 4;
  display: block;
  width: 100%;
  image-rendering: pixelated;
}

.hero-isle img[src=""] {
  visibility: hidden;
}

.hero-grass {
  position: absolute;
  z-index: 3;
  left: 4%;
  width: 92%;
  top: 38%;
  height: 32%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 20% 60%, #ffffff 0 2px, transparent 2.5px) 0 0 / 22px 14px,
    radial-gradient(circle at 70% 30%, #fff2c0 0 1.5px, transparent 2px) 0 0 / 18px 12px,
    radial-gradient(ellipse at 38% 30%, #a3d87c 0%, #76b25a 52%, #548e3f 100%);
  box-shadow: 0 3px 0 #3d6e34;
}

.hero-sand {
  position: absolute;
  z-index: 2;
  left: -6%;
  width: 112%;
  top: 36%;
  height: 44%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 45% 35%, #f5ead4 0%, #e3cfa8 62%, #b89c72 100%);
  box-shadow: 0 0 0 4px rgba(236, 250, 244, 0.8), 0 7px 0 3px rgba(30, 100, 100, 0.25);
}

.hero-water {
  position: absolute;
  z-index: 1;
  left: -24%;
  width: 148%;
  top: 26%;
  height: 66%;
  border-radius: 50%;
  background: radial-gradient(ellipse closest-side, rgba(214, 244, 236, 0.95) 0%, rgba(120, 200, 190, 0.85) 45%, rgba(60, 140, 140, 0.5) 75%, rgba(60, 140, 140, 0) 100%);
  animation: ripple 4.5s ease-in-out infinite;
}

@keyframes ripple {
  50% { transform: scale(1.05); opacity: 0.85; }
}

/* =====================================================================
   LAYAR LOADING
   ===================================================================== */
#loadingScreen {
  z-index: 55;
  justify-content: flex-start;
  padding-top: 7vh; /* di langit senja, di atas kubah masjid */
}

/* lentera Maroko yang berayun di rantainya selama aset dimuat */
.loading-lantern {
  display: block;
  width: 64px;
  height: 134px;
  margin-bottom: 18px;
  transform-origin: 50% 0;
  animation: lanternSwing 2.6s ease-in-out infinite, lanternGlow 1.6s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(255, 196, 110, 0.8));
}

@keyframes lanternSwing {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}

@keyframes lanternGlow {
  50% { opacity: 0.85; }
}

#loadingText {
  font-size: 13px;
  font-weight: 600;
  color: #fff8e6;
  text-shadow: 0 1px 6px rgba(20, 40, 50, 0.6);
  margin-bottom: 12px;
}

.loading-bar-track {
  width: min(70vw, 280px);
  height: 12px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 3px rgba(18, 63, 51, 0.25);
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f8f73, var(--gold), var(--gold-2));
  transition: width 0.2s ease-out;
}

/* =====================================================================
   DUNIA GAME + HUD
   ===================================================================== */
#gameWrap {
  position: fixed;
  inset: 0;
  display: none;
  overflow: hidden;
}

#phaserContainer {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--sea-2);
}

#touchLayer {
  position: absolute;
  inset: 0;
  z-index: 5;
  touch-action: none;
}

#hud {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  z-index: 6;
  transform: translateX(-50%);
  max-width: calc(100% - 200px);
  padding: 6px 16px 7px;
  border-radius: 18px;
  background: var(--glass-dark);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 6px 18px rgba(10, 36, 30, 0.25);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  pointer-events: none;
  text-align: center;
}

#hudTitle {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#hudCountdown {
  margin-top: 2px;
  font-size: 9px;
  color: var(--gold-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* tombol bulat kaca (siang/malam, menu, emote, chat) */
#ambienceBtn,
#menuToggleBtn,
.emote-btn,
#chatToggleBtn {
  border-radius: 50%;
  background: var(--glass-dark);
  border: 1.5px solid rgba(246, 217, 138, 0.85);
  color: var(--gold-2);
  box-shadow: 0 6px 16px rgba(10, 36, 30, 0.28);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
  line-height: 1;
  transition: transform 0.2s ease, background 0.2s ease;
}

#ambienceBtn:active,
#menuToggleBtn:active,
.emote-btn:active,
#chatToggleBtn:active {
  transform: scale(0.9);
  background: var(--rose);
}

#ambienceBtn {
  position: absolute;
  z-index: 20;
  top: calc(10px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  font-size: 19px;
}

/* ---------- Menu cepat (kanan atas, di bawah tombol siang/malam) ---------- */
#menuToggleBtn {
  position: absolute;
  z-index: 20;
  top: calc(62px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  font-size: 18px;
}

#menuToggleBtn[aria-expanded="true"] {
  background: var(--rose);
  color: #fff;
}

#quickMenu {
  position: absolute;
  z-index: 20;
  top: calc(114px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  max-height: calc(100% - 134px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding: 2px;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear 0.3s;
}

#quickMenu.open {
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.menu-item {
  flex-shrink: 0;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid rgba(246, 217, 138, 0.7);
  background: rgba(18, 60, 50, 0.84);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fdf6ea;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(10, 36, 30, 0.25);
  opacity: 0;
  transform: translateX(24px) scale(0.96);
  transition: opacity 0.2s ease, transform 0.28s cubic-bezier(.2, .8, .2, 1.2);
}

/* muncul berurutan dari atas ke bawah (--i = urutan item, diisi script.js) */
#quickMenu.open .menu-item {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i) * 35ms);
}

.menu-item:active {
  background: var(--rose);
}

/* musik / efek suara sedang menyala */
.menu-item.on {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  border-color: #fff;
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Kartu ucapan dari lampion (ketuk untuk menutup) ---------- */
#wishCard {
  position: absolute;
  z-index: 22;
  left: 50%;
  bottom: calc(150px + env(safe-area-inset-bottom));
  width: min(86vw, 330px);
  padding: 12px 15px;
  border: 1px solid rgba(243, 213, 142, 0.85);
  border-radius: 16px;
  background: rgba(16, 48, 42, 0.94);
  box-shadow: 0 0 26px rgba(255, 196, 106, 0.45);
  color: #fff4e0;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
}

#wishCard.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

.wish-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #ffe2a0;
}

.wish-card-status {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(243, 213, 142, 0.2);
  color: #fff0c8;
  white-space: nowrap;
}

.wish-card-msg {
  font-size: 12px;
  line-height: 1.5;
  max-height: 40vh;
  overflow-y: auto;
  word-break: break-word;
}

/* ---------- Petunjuk interaksi (ketuk untuk membuka) ---------- */
#prompt {
  position: absolute;
  left: 50%;
  bottom: calc(112px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 6;
  display: none;
  max-width: calc(100% - 32px);
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--gold-2);
  background: linear-gradient(135deg, rgba(16, 58, 48, 0.94), rgba(31, 107, 84, 0.94));
  box-shadow: 0 8px 22px rgba(10, 36, 30, 0.35), 0 0 0 4px rgba(246, 217, 138, 0.16);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
  cursor: pointer;
  animation: promptIn 0.35s cubic-bezier(.2, .8, .2, 1.3), promptGlow 1.8s ease-in-out infinite 0.4s;
}

@keyframes promptIn {
  from { opacity: 0; transform: translate(-50%, 10px) scale(0.9); }
  to { opacity: 1; transform: translateX(-50%); }
}

@keyframes promptGlow {
  50% { box-shadow: 0 8px 22px rgba(10, 36, 30, 0.35), 0 0 0 7px rgba(246, 217, 138, 0.06); }
}

#prompt:active {
  background: var(--rose);
}

/* ---------- Tutorial onboarding singkat ---------- */
#tutorialOverlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 45%, rgba(10, 34, 30, 0.3), rgba(10, 34, 30, 0.58));
  transition: opacity 0.4s ease;
  opacity: 1;
}

#tutorialOverlay.hide {
  opacity: 0;
  pointer-events: none;
}

#tutorialCard {
  width: min(92vw, 340px);
  padding: 20px 20px 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-align: left;
  animation: cardPop 0.45s cubic-bezier(.2, .8, .2, 1.2);
}

@keyframes cardPop {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

.tutorial-head {
  margin-bottom: 10px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  text-align: center;
  color: var(--ink);
}

#tutorialList div {
  padding: 7px 10px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  animation: riseIn 0.5s ease forwards; /* jeda tiap baris diisi script.js (muncul berurutan) */
}

.tutorial-skip {
  margin-top: 10px;
  font-size: 10px;
  text-align: center;
  color: var(--ink-soft);
  animation: blink 1.6s ease-in-out infinite;
}

@keyframes blink {
  50% { opacity: 0.35; }
}

/* ---------- Kontrol sosial: emote + chat (kiri bawah) ---------- */
#socialControls {
  position: absolute;
  z-index: 20;
  left: calc(16px + env(safe-area-inset-left));
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#emoteBar {
  display: flex;
  gap: 6px;
}

.emote-btn {
  width: 40px;
  height: 40px;
  font-size: 17px;
}

/* ---------- Tombol zoom (kanan bawah): + perbesar, − kembali ke seluruh taman ---------- */
#zoomControls {
  position: absolute;
  z-index: 20;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#zoomControls button {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--glass-dark);
  border: 1.5px solid rgba(246, 217, 138, 0.85);
  color: var(--gold-2);
  box-shadow: 0 6px 16px rgba(10, 36, 30, 0.28);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

#zoomControls button:active:not(:disabled) {
  transform: scale(0.9);
  background: var(--rose);
}

#zoomControls button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* saat memilih filter photo booth, bilah filter memakai bagian bawah layar */
#photoFilterBar.show ~ #zoomControls {
  visibility: hidden;
}

#chatToggleBtn {
  width: 52px;
  height: 52px;
  font-size: 20px;
}

#chatComposer {
  position: absolute;
  z-index: 25;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: none;
  gap: 6px;
  width: min(86vw, 340px);
  padding: 6px;
  border-radius: 999px;
  background: var(--glass-dark);
  border: 1px solid rgba(246, 217, 138, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

#chatInput {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

#chatSendBtn {
  width: 40px;
  border: none;
  border-radius: 50%;
  background: var(--rose);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

/* ---------- Joystick dinamis: muncul di titik swipe ---------- */
#joystickBase {
  position: absolute;
  z-index: 15;
  display: none;
  pointer-events: none;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25), rgba(16, 58, 48, 0.35));
  border: 2px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 5px rgba(246, 217, 138, 0.25);
  transform: translate(-50%, -50%);
}

#joystickKnob {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff2c0, var(--gold));
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(10, 36, 30, 0.35);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* =====================================================================
   DIALOG (modal)
   ===================================================================== */
#modalOverlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 30, 26, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

#modalBox {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 84vh;
  overflow-y: auto;
  padding: 20px 18px 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(243, 213, 142, 0.16), transparent 60%),
    linear-gradient(180deg, #1d5446 0%, var(--panel-solid) 100%);
  box-shadow: 0 20px 50px rgba(6, 24, 20, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: cardPop 0.35s cubic-bezier(.2, .8, .2, 1.15);
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 217, 138, 0.5) transparent;
}

#modalBox h2 {
  margin: 0 36px 14px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(246, 217, 138, 0.35);
  font-size: 15px;
  font-weight: 600;
  color: var(--gold-2);
}

#modalBox .close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

#modalBox .close:active {
  background: var(--rose);
}

#modalBody {
  font-size: 13px;
  line-height: 1.7;
}

#modalBody b {
  color: var(--gold-2);
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 8px 0 8px 18px;
  border-left: 2px solid rgba(246, 217, 138, 0.4);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(246, 217, 138, 0.25);
}

.timeline-time {
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 600;
  min-width: 56px;
}

/* ---------- Kartu profil mempelai (di dialog Balai Informasi) ---------- */
.profile-cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.profile-card {
  flex: 1 1 0;
  min-width: 130px;
  background: #fdf6ea;
  border-radius: 16px;
  padding: 16px 10px 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  text-align: center;
  color: #3a2a20;
}

.profile-photo-frame {
  position: relative;
  width: 80%;
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  border: 3px solid #c9a45c;
  border-radius: 999px 999px 12px 12px;
  overflow: hidden;
  background: #e6ddc8;
}

.profile-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-photo-frame .corner {
  display: none;
}

.profile-badge {
  position: relative;
  z-index: 3;
  width: max-content;
  max-width: 90%;
  margin: -14px auto 8px;
  background: #fdf6ea;
  border: 1px solid #c9a45c;
  border-radius: 999px;
  color: #8b2635;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.3;
  text-transform: uppercase;
  padding: 5px 10px;
}

.profile-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.profile-parents {
  background: #f3e6c8;
  border-radius: 10px;
  padding: 8px;
  text-align: left;
  font-size: 10px;
  line-height: 1.6;
}

.profile-parents-label {
  color: #8b2635;
  font-weight: 700;
  font-size: 9px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.profile-parents .pp-label {
  color: #8b2635;
  font-weight: 700;
  margin-right: 3px;
}

.profile-ig {
  margin-top: 8px;
  font-size: 10px;
  opacity: 0.85;
}

/* ---------- Galeri ---------- */
.gallery-tabs {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.gallery-tab-btn {
  flex: 1;
  padding: 8px 6px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--gold-2);
  font-size: 12px;
  cursor: pointer;
  opacity: 0.7;
}

.gallery-tab-btn.active {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: var(--ink);
  opacity: 1;
  font-weight: 700;
}

.gallery-slideshow {
  margin-top: 10px;
}

.gallery-slideshow[hidden] {
  display: none;
}

.gallery-slide-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0c211d;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gallery-slide-frame .gallery-slide {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
  display: none;
}

.gallery-slide-frame .gallery-slide.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
}

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

.gallery-nav-btn {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--gold-2);
  font-size: 12px;
  cursor: pointer;
}

.gallery-nav-btn:active {
  background: var(--rose);
  color: #fff;
}

.gallery-counter {
  font-size: 11px;
  opacity: 0.85;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.gallery-dot.active {
  width: 20px;
  border-radius: 999px;
  background: var(--gold-2);
}

/* ---------- Formulir RSVP & tombol aksi ---------- */
form label {
  display: block;
  font-size: 11px;
  margin: 12px 0 5px;
  color: var(--gold-2);
}

form input,
form select,
form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(246, 217, 138, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

form input:focus,
form select:focus,
form textarea:focus {
  border-color: var(--gold-2);
  box-shadow: 0 0 0 3px rgba(246, 217, 138, 0.18);
}

form select option {
  color: var(--ink);
}

form button,
.action-btn {
  margin-top: 14px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #3ddc84, #1faa59);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(31, 170, 89, 0.3);
}

.action-btn.secondary {
  background: linear-gradient(135deg, #e0bb62, #b8862c);
  box-shadow: 0 6px 16px rgba(184, 134, 44, 0.3);
}

a.action-btn {
  display: block;
  text-align: center;
  text-decoration: none;
}

form button:active,
.action-btn:active {
  transform: scale(0.98);
}

/* ---------- Photo booth ---------- */
.photo-result {
  display: block;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

#photoCountdown {
  position: absolute;
  z-index: 24;
  left: 50%;
  top: 50%;
  font-size: 110px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 5px 0 var(--rose), 0 0 30px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
}

#photoCountdown.pop {
  animation: photoPop 0.75s ease-out forwards;
}

@keyframes photoPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.85); }
}

.copy-btn {
  margin-top: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: 999px;
  background: var(--rose);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.gift-account {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(246, 217, 138, 0.3);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.gift-account:last-child {
  margin-bottom: 0;
}

.map-embed {
  width: 100%;
  height: 220px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-top: 8px;
}

.map-location {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px dashed rgba(246, 217, 138, 0.35);
}

.map-location:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.map-location-title {
  font-size: 13px;
  color: var(--gold-2);
  margin: 0 0 6px 0;
}

.note {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 10px;
}

.wish-item {
  padding: 9px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 255, 255, 0.06);
}

.wish-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.wish-status {
  font-size: 10px;
  opacity: 0.75;
}

.wish-msg {
  font-size: 12px;
  margin-top: 4px;
  opacity: 0.9;
  line-height: 1.5;
}

/* =====================================================================
   SINEMATIK PEMBUKA: letterbox, kartu judul, tombol lewati
   ===================================================================== */
.cinema-bar {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 21;
  height: 10vh;
  background: linear-gradient(180deg, #0f2e2c, #1c4a40);
  pointer-events: none;
  transition: transform 0.7s ease;
}

.cinema-bar.top {
  top: 0;
  transform: translateY(-100%);
}

.cinema-bar.bottom {
  bottom: 0;
  transform: translateY(100%);
  background: linear-gradient(0deg, #0f2e2c, #1c4a40);
}

#gameWrap.cinema .cinema-bar {
  transform: none;
}

#titleCard {
  position: absolute;
  z-index: 22;
  left: 50%;
  top: 50%;
  width: min(96vw, 620px);
  padding: 40px 12px;
  background: radial-gradient(ellipse at center, rgba(10, 38, 34, 0.62) 0%, rgba(10, 38, 34, 0.36) 45%, rgba(10, 38, 34, 0) 72%);
  text-align: center;
  text-shadow: 0 2px 18px rgba(6, 24, 20, 0.6);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -44%);
  transition: opacity 0.9s ease, transform 1.2s ease;
}

#titleCard.show {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.tc-kicker {
  font-size: 11px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: #f3d58e;
}

.tc-names {
  margin: 6px 0;
  font-family: var(--script);
  font-size: clamp(46px, 12vw, 82px);
  line-height: 1.15;
  color: #fff;
}

.tc-names span {
  color: var(--gold-2);
}

.tc-line {
  width: 140px;
  height: 2px;
  margin: 4px auto 10px;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
}

.tc-date {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff4e0;
}

#skipCinemaBtn {
  display: none;
  position: absolute;
  z-index: 23;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(3vh + env(safe-area-inset-bottom));
  padding: 8px 16px;
  border: 1px solid rgba(246, 217, 138, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold-2);
  font-size: 12px;
  cursor: pointer;
}

#gameWrap.cinema #skipCinemaBtn {
  display: block;
}

/* selama sinematik & mini game, kontrol HUD disembunyikan (mini game punya HUD sendiri di Phaser) */
#gameWrap.cinema #hud,
#gameWrap.cinema #ambienceBtn,
#gameWrap.cinema #menuToggleBtn,
#gameWrap.cinema #quickMenu,
#gameWrap.cinema #questPill,
#gameWrap.cinema #socialControls,
#gameWrap.cinema #zoomControls,
#gameWrap.cinema #chatComposer,
#gameWrap.cinema #prompt,
#gameWrap.minigame #hud,
#gameWrap.minigame #ambienceBtn,
#gameWrap.minigame #menuToggleBtn,
#gameWrap.minigame #quickMenu,
#gameWrap.minigame #questPill,
#gameWrap.minigame #socialControls,
#gameWrap.minigame #zoomControls,
#gameWrap.minigame #chatComposer,
#gameWrap.minigame #prompt,
#gameWrap.minigame #wishCard {
  visibility: hidden;
}

/* mini game menerima sentuhan langsung di kanvas Phaser */
#gameWrap.minigame #touchLayer,
#gameWrap.minigame #joystickBase {
  display: none;
}

/* ---------- Pil progres "Jejak Kisah Cinta" (kiri atas) ---------- */
#questPill {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(10px + env(safe-area-inset-top));
  left: calc(14px + env(safe-area-inset-left));
  height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--gold-2);
  border-radius: 999px;
  background: var(--glass-dark);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 16px rgba(10, 36, 30, 0.28);
  color: #fff0c8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#questPill.done {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  border-color: #fff;
  color: #fff;
}

#questPill.pop {
  animation: pillPop 0.5s ease;
}

@keyframes pillPop {
  40% { transform: scale(1.35); }
}

/* ---------- Toast pemberitahuan ---------- */
#toast {
  position: absolute;
  z-index: 24;
  left: 50%;
  top: calc(64px + env(safe-area-inset-top));
  max-width: min(88vw, 370px);
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(16, 52, 45, 0.93);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 22px rgba(6, 24, 20, 0.35);
  color: #fff4e0;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  white-space: pre-line;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -12px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(.2, .8, .2, 1.3), visibility 0s linear 0.3s;
}

#toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

/* ---------- Pilihan filter photo booth ---------- */
#photoFilterBar {
  position: absolute;
  z-index: 25;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: min(94vw, 470px);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(16, 52, 45, 0.93);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 20px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

#photoFilterBar.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

.pf-hint {
  margin-bottom: 8px;
  font-size: 11px;
  text-align: center;
  opacity: 0.8;
}

.pf-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.pf-chip {
  flex: 0 0 auto;
  padding: 7px 13px;
  border: 1px solid rgba(246, 217, 138, 0.45);
  border-radius: 999px;
  background: transparent;
  color: #f4f1ea;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.pf-chip.active {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  border-color: var(--gold-2);
  color: var(--ink);
  font-weight: 700;
}

.pf-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.pf-actions button {
  flex: 1;
  padding: 11px;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.pf-cancel {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.pf-actions .pf-shoot {
  flex: 2;
  background: linear-gradient(135deg, #e0bb62, #b8862c);
  color: #fff;
}

/* ---------- Dialog "Jejak Kisah Cinta" ---------- */
.story-card {
  position: relative;
  margin: 10px 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: #fdf6ea;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  color: #3a2a20;
}

.story-card.new {
  animation: storyIn 0.5s ease;
}

.story-card.locked {
  border: 1px dashed rgba(246, 217, 138, 0.45);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
  color: #c9c3b8;
}

@keyframes storyIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.story-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #8b2635;
}

.story-card.locked .story-meta {
  color: var(--gold-2);
}

.story-year {
  padding: 2px 9px;
  border-radius: 999px;
  background: #8b2635;
  color: #fff;
}

.story-title {
  margin: 4px 0 6px;
  font-family: var(--script);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
  color: #8b2635;
}

.story-card.locked .story-title {
  font-family: inherit;
  font-size: 15px;
  color: #c9c3b8;
}

.story-photo {
  display: block;
  width: 100%;
  margin: 4px 0 8px;
  border-radius: 12px;
}

.story-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

.story-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.story-dots span {
  width: 10px;
  height: 10px;
  border: 1px solid var(--gold-2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.story-dots span.on {
  background: var(--gold-2);
}

.story-status {
  text-align: center;
}

.action-btn.story-all-btn {
  border: 1px solid var(--gold-2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--gold-2);
  box-shadow: none;
}

/* ---------- Layar sempit (HP tegak) ---------- */
@media (max-width: 480px) {
  #hud {
    max-width: calc(100% - 140px);
    padding: 5px 12px 6px;
  }

  #hudTitle {
    font-size: 10px;
  }

  #questPill {
    height: 34px;
    padding: 0 11px;
    font-size: 12px;
  }
}

/* hormati pengaturan "kurangi gerakan" di perangkat */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
