/* =====================================================================
   LAGUNA ASMARA — tema laguna tropis: laut toska, pasir pantai, koral & emas senja.
   Semua animasi hias memakai transform/opacity saja supaya ringan di HP.
   ===================================================================== */
:root {
  --sky-1: #ffd29f;   /* langit senja (atas) */
  --sky-2: #ffb5a3;   /* langit senja dekat cakrawala */
  --blush: #ffe1d2;
  --peach: #ffe9c9;
  --sea-1: #3fbccf;   /* laut dangkal */
  --sea-2: #1c75a3;   /* laut dalam */
  --ink: #15384f;
  --ink-soft: #3f6a82;
  --gold: #e8b45a;
  --gold-2: #f6d98a;
  --rose: #ff6f61;    /* koral */
  --rose-2: #ffa290;
  --panel: rgba(12, 44, 64, 0.92);
  --panel-solid: #0f3148;
  --glass: rgba(255, 255, 255, 0.68);
  --glass-dark: rgba(10, 52, 74, 0.62);
  --line: rgba(246, 217, 138, 0.55);
  --shadow: 0 10px 30px rgba(16, 56, 79, 0.25);
  --script: 'Great Vibes', cursive;
  --serif: 'Cormorant Garamond', Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 44%, var(--sea-1) 56%, var(--sea-2) 100%);
  font-family: 'Poppins', sans-serif;
  color: #f4f1ea;
  -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;
}

/* =====================================================================
   PEMANDANGAN LAUT SENJA (layar pembuka & loading)
   Matahari tenggelam di cakrawala, jejak cahayanya berkilau di air, ombak
   bergeser pelan, perahu layar & camar melintas, pulau nyiur di kejauhan.
   ===================================================================== */
#skyBackdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, #ffd9a4 0%, #ffbfa0 28%, #f9a7ae 52%, #f3a2b4 56%);
  transition: opacity 0.8s ease;
}

#skyBackdrop.hide {
  opacity: 0;
}

/* matahari: separuhnya sudah tenggelam di balik laut (.sea digambar di atasnya) */
#skyBackdrop .sun {
  position: absolute;
  left: 76%;
  top: 56%;
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffbe8 0%, #ffe7a8 30%, rgba(255, 190, 120, 0.75) 50%, rgba(255, 170, 120, 0) 70%);
  animation: sunPulse 6s ease-in-out infinite;
}

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

#skyBackdrop .sea {
  position: absolute;
  left: 0;
  right: 0;
  top: 56%;
  bottom: 0;
  background: linear-gradient(180deg, #66c9d0 0%, #3aa9c6 22%, #2388b5 58%, #1a6897 100%);
  box-shadow: inset 0 2px 0 rgba(255, 244, 214, 0.75);
}

/* jejak cahaya matahari: garis-garis emas yang berkilau di permukaan air */
#skyBackdrop .sun-path {
  position: absolute;
  left: 76%;
  top: 0;
  width: 150px;
  height: 62%;
  margin-left: -75px;
  background: repeating-linear-gradient(180deg, rgba(255, 236, 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; }
}

/* ombak: 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.5) 0 16px, transparent 16px 52px);
  animation: swell 9s linear infinite;
}

#skyBackdrop .s1 { top: 18%; opacity: 0.55; }
#skyBackdrop .s2 { top: 42%; animation-duration: 7s; animation-direction: reverse; height: 3px; }
#skyBackdrop .s3 { top: 70%; animation-duration: 5.5s; height: 3px; opacity: 0.8; }
#skyBackdrop .s4 { top: 88%; animation-duration: 6.5s; animation-direction: reverse; height: 4px; opacity: 0.7; }

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

/* pulau nyiur di cakrawala */
#skyBackdrop .isle-far {
  position: absolute;
  top: calc(56% - 14px);
  width: 120px;
  height: 18px;
  border-radius: 50% 50% 0 0;
  background: linear-gradient(180deg, #4f8f6b, #2f6d63);
}

#skyBackdrop .isle-far.i1 { left: 6%; }
#skyBackdrop .isle-far.i2 { right: 8%; width: 80px; height: 12px; top: calc(56% - 10px); opacity: 0.85; }

#skyBackdrop .isle-far i {
  position: absolute;
  bottom: 60%;
  width: 3px;
  height: 34px;
  border-radius: 2px;
  background: #5a4a3a;
  transform-origin: bottom center;
}

#skyBackdrop .isle-far i:nth-child(1) { left: 38%; transform: rotate(-8deg); }
#skyBackdrop .isle-far i:nth-child(2) { left: 58%; height: 26px; transform: rotate(10deg); }

/* tajuk nyiur: pelepah dari bayangan elips yang diputar */
#skyBackdrop .isle-far i::before,
#skyBackdrop .isle-far i::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -14px;
  width: 30px;
  height: 9px;
  border-radius: 50%;
  background: #3e7d4f;
  transform: rotate(-18deg);
  box-shadow: 12px 4px 0 -2px #356e46;
}

#skyBackdrop .isle-far i::after {
  transform: rotate(22deg);
  left: -12px;
  top: -2px;
  box-shadow: -10px 5px 0 -2px #356e46;
}

/* perahu layar berlayar pelan di cakrawala */
#skyBackdrop .sailboat {
  position: absolute;
  top: calc(56% - 30px);
  left: 0;
  width: 30px;
  height: 34px;
  will-change: transform;
  animation: sail 55s linear infinite;
}

#skyBackdrop .sailboat::before {
  /* layar */
  content: '';
  position: absolute;
  left: 11px;
  bottom: 8px;
  border-left: 16px solid #fffaf2;
  border-top: 24px solid transparent;
}

#skyBackdrop .sailboat::after {
  /* lambung */
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 7px;
  border-radius: 0 0 12px 12px;
  background: #7a4f2e;
}

#skyBackdrop .sailboat span {
  position: absolute;
  left: 8px;
  bottom: 9px;
  border-right: 10px solid #ff8f7e;
  border-top: 16px solid transparent;
}

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

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

#skyBackdrop .gull::before,
#skyBackdrop .gull::after {
  content: '';
  position: absolute;
  top: 0;
  width: 11px;
  height: 8px;
  border-top: 2px solid rgba(80, 60, 70, 0.75);
  border-radius: 50% 50% 0 0;
  animation: flap 0.9s 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: 16%; animation-delay: -6s; }
#skyBackdrop .g2 { top: 26%; width: 16px; height: 6px; animation-duration: 34s; 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, 255, 255, 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; }
#skyBackdrop .sparkles i:nth-child(7) { left: 30%; top: 78%; animation-delay: 2.6s; }
#skyBackdrop .sparkles i:nth-child(8) { left: 92%; top: 66%; animation-delay: 1.9s; }

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  50% { opacity: 1; transform: scale(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;
}

.intro-card {
  position: relative;
  width: min(92vw, 400px);
  padding: 26px 22px 20px;
  border-radius: 26px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.85);
  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 */
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 20px;
  border: 1px solid var(--line);
  pointer-events: none;
}

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

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

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

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

.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: var(--gold);
}

.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.6);
  border: 1px dashed rgba(176, 138, 58, 0.6);
}

#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(176, 138, 58, 0.45);
  background: rgba(255, 255, 255, 0.85);
  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(226, 182, 89, 0.25);
}

.cta {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9a82 0%, var(--rose) 55%, #e0503f 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 111, 97, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.3s ease;
}

.cta::after {
  /* kilau yang menyapu tombol */
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 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(255, 111, 97, 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 pulau pasir kecil di tengah laguna, mengayun pelan di atas kartu undangan */
.intro-hero {
  position: relative;
  flex-shrink: 0;
  width: min(64vw, 290px, 34vh);
  margin-bottom: 6px;
  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, 255, 255, 0.85) 0%, rgba(255, 240, 220, 0.4) 35%, rgba(255, 255, 255, 0) 65%);
  animation: sunPulse 5s ease-in-out infinite;
}

/* pulau mini: gambar pelaminan (rasio ~7:6) di atas rumput, dikelilingi pasir, buih & air dangkal toska */
.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(ellipse at 38% 30%, #9bd876 0%, #6fae57 52%, #4e8a3b 100%);
  box-shadow: 0 3px 0 #3f7632;
}

.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%, #fcecbf 0%, #f1dca5 62%, #d9bf86 100%);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.85), 0 7px 0 3px rgba(20, 110, 130, 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, 246, 236, 0.95) 0%, rgba(126, 218, 214, 0.85) 45%, rgba(58, 180, 204, 0.5) 75%, rgba(58, 180, 204, 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: 24vh; /* di langit senja, di atas cakrawala */
}

/* perahu hias mengayun di atas ombak selama aset dimuat */
.loading-boat {
  position: relative;
  width: 92px;
  height: 64px;
  margin-bottom: 26px;
  animation: boatRock 2.4s ease-in-out infinite;
}

@keyframes boatRock {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-5px) rotate(3deg); }
}

/* lambung kayu dengan garis putih & koral */
.loading-boat .hull {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 20px;
  border-radius: 6px 6px 46px 46px / 6px 6px 30px 30px;
  background:
    linear-gradient(180deg, #fff4e6 0 3px, #ff6f61 3px 6px, transparent 6px),
    linear-gradient(180deg, #94613a, #5a381e);
}

/* kanopi putih berhias bunga */
.loading-boat .canopy {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 24px;
  height: 30px;
  border: 3px solid #fbf6ee;
  border-bottom: none;
  border-radius: 40px 40px 0 0;
  background: linear-gradient(180deg, #fffaf2 0 9px, transparent 9px);
}

.loading-boat .canopy::after {
  content: '';
  position: absolute;
  left: 2px;
  right: 2px;
  top: 7px;
  height: 5px;
  background: radial-gradient(circle, #ffc4d4 45%, transparent 50%) 0 0 / 8px 5px repeat-x;
}

.loading-boat .flag {
  position: absolute;
  left: 6px;
  bottom: 24px;
  width: 2px;
  height: 28px;
  background: #6b4426;
}

.loading-boat .flag::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 0;
  border-left: 12px solid #ff6f61;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

/* ombak kecil di bawah perahu */
.loading-boat::after {
  content: '';
  position: absolute;
  left: -30px;
  right: -30px;
  bottom: 0;
  height: 6px;
  border-radius: 50%;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0 12px, transparent 12px 22px);
  animation: waveShift 1.6s linear infinite;
}

@keyframes waveShift {
  to { transform: translateX(22px); }
}

#loadingText {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
}

.loading-bar-track {
  width: min(70vw, 280px);
  height: 12px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 3px rgba(16, 56, 79, 0.2);
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose-2), var(--rose), var(--gold));
  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(8, 36, 54, 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(8, 36, 54, 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(10, 52, 74, 0.78);
  -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(8, 36, 54, 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(255, 179, 92, 0.8);
  border-radius: 16px;
  background: rgba(10, 40, 58, 0.9);
  box-shadow: 0 0 26px rgba(255, 154, 60, 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: #ffd27a;
}

.wish-card-status {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 179, 92, 0.2);
  color: #ffe2b0;
  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(10, 52, 74, 0.92), rgba(18, 86, 110, 0.92));
  box-shadow: 0 8px 22px rgba(8, 36, 54, 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(8, 36, 54, 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(8, 44, 64, 0.35), rgba(8, 44, 64, 0.6));
  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 pulau ---------- */
#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(8, 36, 54, 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(10, 52, 74, 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%, #ffc9bd, var(--rose));
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(8, 36, 54, 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(6, 34, 50, 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(246, 217, 138, 0.14), transparent 60%),
    linear-gradient(180deg, #134a66 0%, var(--panel-solid) 100%);
  box-shadow: 0 20px 50px rgba(4, 24, 36, 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: #151029;
  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, #ff9a82, var(--rose));
  box-shadow: 0 6px 16px rgba(255, 111, 97, 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, #0b2a3d, #134a66);
  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, #0b2a3d, #134a66);
}

#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(8, 44, 64, 0.62) 0%, rgba(8, 44, 64, 0.38) 45%, rgba(8, 44, 64, 0) 72%);
  text-align: center;
  text-shadow: 0 2px 18px rgba(4, 24, 36, 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: #ffe9b0;
}

.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(--rose-2);
  border-radius: 999px;
  background: var(--glass-dark);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 16px rgba(8, 36, 54, 0.28);
  color: #ffd1e0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#questPill.done {
  background: linear-gradient(135deg, var(--rose-2), var(--rose));
  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(10, 52, 74, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 22px rgba(4, 24, 36, 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(10, 52, 74, 0.92);
  -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, #ff9a82, var(--rose));
  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(--rose-2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.story-dots span.on {
  background: var(--rose-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;
  }
}
