:root {
  --dark: #1a1a2e;
  --panel: #16213e;
  --accent: #e94560;
  --gold: #f2c94c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--dark);
  font-family: 'Poppins', sans-serif;
  color: #f4f1ea;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}

.pixel-font {
  font-family: 'Poppins', sans-serif;
}

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

/* ---------- Intro screen ---------- */
#intro,
#slugPrompt {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #2d1b4e 0%, #1a1a2e 80%);
  text-align: center;
  padding: 24px;
}

#intro .ring,
#slugPrompt .ring {
  font-size: 40px;
  margin-bottom: 12px;
}

#intro h1,
#slugPrompt h1 {
  font-size: 14px;
  line-height: 2;
  color: var(--gold);
  text-shadow: 2px 2px 0 #5c3d0e;
  margin: 0 0 18px 0;
}

#intro .names {
  font-size: 20px;
  color: #fff;
  margin: 8px 0 18px 0;
  text-shadow: 3px 3px 0 var(--accent);
}

/* nama tamu dari link personal (?to=...) */
#introGuest {
  display: none;
  margin: -4px 0 18px 0;
  padding: 10px 20px;
  max-width: 86vw;
  border: 1px solid rgba(242, 201, 76, 0.5);
  border-radius: 10px;
  background: rgba(15, 22, 38, 0.55);
}

#introGuest .guest-label {
  font-size: 11px;
  opacity: 0.8;
}

#introGuest .guest-name {
  margin: 4px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  word-break: break-word;
}

#introGuest .guest-note {
  font-size: 9px;
  font-style: italic;
  opacity: 0.6;
}

#nameInput,
#slugInput {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  padding: 10px 12px;
  background: #0f1626;
  color: #fff;
  border: 2px solid var(--gold);
  text-align: center;
  margin-bottom: 16px;
  width: 220px;
  max-width: 80vw;
}

#intro .hint,
#slugPrompt .hint {
  font-size: 11px;
  opacity: 0.75;
}

#intro .hint {
  margin-top: 24px;
}

#slugPrompt .hint {
  margin-bottom: 20px;
  line-height: 1.6;
}

#mpWarning {
  font-size: 9px;
  color: #ff8b8b;
  margin-top: 10px;
  display: none;
  max-width: 260px;
}

#intro .engine-tag {
  font-size: 9px;
  opacity: 0.5;
  margin-top: 30px;
}

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

#intro .hint {
  animation: blink 1.4s infinite;
}

#startBtn,
#slugSubmitBtn {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  padding: 14px 22px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border: 4px solid #fff;
  box-shadow: 4px 4px 0 #000;
}

#startBtn:active,
#slugSubmitBtn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

#startBtn.disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ---------- Loading screen (saat memuat aset gambar) ---------- */
#loadingScreen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #2d1b4e 0%, #1a1a2e 80%);
  text-align: center;
  padding: 24px;
}

.loading-ring {
  font-size: 40px;
  margin-bottom: 18px;
  animation: loadingPulse 1.1s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.85;
  }

  50% {
    transform: scale(1.18);
    opacity: 1;
  }
}

#loadingText {
  font-size: 11px;
  color: var(--gold);
  margin-bottom: 14px;
}

.loading-bar-track {
  width: min(70vw, 260px);
  height: 14px;
  border: 2px solid var(--gold);
  background: #0f1626;
  padding: 2px;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s ease-out;
}

/* ---------- Fullscreen game world ---------- */
#gameWrap {
  position: fixed;
  inset: 0;
  display: none;
  overflow: hidden;
}

#phaserContainer {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #3a8fd6;
}

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

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  pointer-events: none;
  font-size: 10px;
  text-align: center;
  color: var(--gold);
  letter-spacing: 1px;
  padding: calc(10px + env(safe-area-inset-top)) calc(120px + env(safe-area-inset-right)) 16px calc(90px + env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
}

#hudCountdown {
  font-size: 8px;
  color: #ffe9b0;
  margin-top: 6px;
  opacity: 0.9;
}

/* ---------- Tombol suasana siang / malam (kanan atas) ---------- */
#ambienceBtn {
  position: absolute;
  z-index: 20;
  top: calc(10px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--gold);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.25s ease;
}

#ambienceBtn:active {
  background: var(--accent);
  transform: scale(0.9) rotate(-20deg);
}

/* ---------- Menu cepat (kanan atas, di bawah tombol siang/malam) ---------- */
#menuToggleBtn {
  position: absolute;
  z-index: 20;
  top: calc(60px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--gold);
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

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

#quickMenu {
  position: absolute;
  z-index: 20;
  top: calc(110px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  max-height: calc(100% - 130px - 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;
  background: var(--panel);
  border: 2px solid var(--gold);
  border-radius: 999px;
  color: #f4f1ea;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.2s ease, transform 0.25s ease;
}

/* 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(--accent);
}

/* musik sedang diputar */
.menu-item.on {
  background: var(--gold);
  color: var(--dark);
}

/* ---------- 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(84vw, 320px);
  padding: 12px 14px;
  border: 2px solid #ffb35c;
  border-radius: 12px;
  background: rgba(22, 20, 40, 0.92);
  box-shadow: 0 0 24px 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;
}

#prompt {
  position: absolute;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: auto;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid var(--gold);
  padding: 6px 10px;
  font-size: 10px;
  white-space: nowrap;
  display: none;
}

#prompt:active {
  background: rgba(233, 69, 96, 0.85);
}

/* ---------- Tutorial onboarding singkat ---------- */
#tutorialOverlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.4s ease;
  opacity: 1;
}

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

#tutorialCard {
  background: var(--panel);
  border: 4px solid var(--gold);
  box-shadow: 0 0 0 3px #000;
  padding: 22px;
  max-width: 300px;
  text-align: center;
}

#tutorialList div {
  font-size: 10px;
  line-height: 2.5;
  color: #fff;
}

.tutorial-skip {
  margin-top: 16px;
  font-size: 8px;
  opacity: 0.6;
}

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

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

.emote-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--gold);
  font-size: 16px;
  cursor: pointer;
}

.emote-btn:active {
  background: var(--accent);
}

#chatToggleBtn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--gold);
  color: var(--gold);
  font-size: 18px;
  cursor: pointer;
}

#chatToggleBtn:active {
  background: var(--accent);
}

#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(84vw, 320px);
}

#chatInput {
  flex: 1;
  padding: 10px;
  background: #0f1626;
  color: #fff;
  border: 2px solid var(--gold);
  font-family: inherit;
  font-size: 13px;
}

#chatSendBtn {
  width: 42px;
  background: var(--accent);
  color: #fff;
  border: 2px solid #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: rgba(22, 33, 62, 0.5);
  border: 3px solid var(--gold);
  transform: translate(-50%, -50%);
}

#joystickKnob {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* ---------- Modal (RPG dialog box) ---------- */
#modalOverlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#modalBox {
  background: var(--panel);
  border: 5px solid var(--gold);
  box-shadow: 0 0 0 3px #000, 8px 8px 0 rgba(0, 0, 0, 0.5);
  max-width: 480px;
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  padding: 18px;
}

#modalBox h2 {
  font-size: 13px;
  color: var(--gold);
  margin: 0 0 14px 0;
  padding-bottom: 10px;
  border-bottom: 2px dashed var(--gold);
}

#modalBox .close {
  float: right;
  cursor: pointer;
  background: var(--accent);
  border: 2px solid #fff;
  color: #fff;
  font-size: 11px;
  padding: 4px 8px;
}

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

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

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

.timeline-item {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}

.timeline-time {
  color: var(--gold);
  font-size: 12px;
  min-width: 68px;
}

/* ---------- Kartu profil mempelai (di modal 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: 14px;
  padding: 16px 10px 14px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  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: 10px;
  overflow: hidden;
  background: #e6ddc8;
}

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

.profile-photo-frame .corner {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #8b2635;
  transform: rotate(45deg);
  z-index: 2;
}

.profile-photo-frame .corner.tl { top: -4px; left: -4px; }
.profile-photo-frame .corner.tr { top: -4px; right: -4px; }
.profile-photo-frame .corner.bl { bottom: -4px; left: -4px; }
.profile-photo-frame .corner.br { bottom: -4px; right: -4px; }

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

.profile-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.profile-parents {
  background: #f3e6c8;
  border-radius: 8px;
  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;
}

.gallery-tabs {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.gallery-tab-btn {
  flex: 1;
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
  font-family: inherit;
  font-size: 11px;
  padding: 7px 6px;
  cursor: pointer;
  opacity: 0.6;
}

.gallery-tab-btn.active {
  background: var(--gold);
  color: #16213e;
  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: 3px solid var(--gold);
  background: #0f1626;
  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;
}

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

.gallery-nav-btn {
  background: var(--panel);
  color: var(--gold);
  border: 2px solid var(--gold);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
}

.gallery-nav-btn:active {
  background: var(--accent);
  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: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid var(--gold);
  cursor: pointer;
  padding: 0;
}

.gallery-dot.active {
  background: var(--gold);
}

form label {
  display: block;
  font-size: 11px;
  margin: 10px 0 4px;
  color: var(--gold);
}

form input,
form select,
form textarea {
  width: 100%;
  padding: 8px;
  background: #0f1626;
  color: #fff;
  border: 2px solid var(--gold);
  font-family: inherit;
  font-size: 13px;
}

form button,
.action-btn {
  margin-top: 14px;
  width: 100%;
  padding: 10px;
  background: #25d366;
  color: #fff;
  border: none;
  font-weight: bold;
  cursor: pointer;
  font-size: 13px;
}

.action-btn.secondary {
  background: var(--accent);
}

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

/* ---------- Photo booth ---------- */
.photo-result {
  display: block;
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 4px 18px 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(--accent), 0 0 30px rgba(0, 0, 0, 0.5);
  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 {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 11px;
}

.gift-account {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(242, 201, 76, 0.4);
}

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

.map-embed {
  width: 100%;
  height: 220px;
  border: 2px solid var(--gold);
  margin-top: 8px;
}

.map-location {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px dashed rgba(242, 201, 76, 0.4);
}

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

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

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

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

.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: 11vh;
  background: #000;
  pointer-events: none;
  transition: transform 0.7s ease;
}

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

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

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

#titleCard {
  position: absolute;
  z-index: 22;
  left: 50%;
  top: 50%;
  width: min(96vw, 600px);
  padding: 40px 12px;
  background: radial-gradient(ellipse at center, rgba(12, 10, 32, 0.72) 0%, rgba(12, 10, 32, 0.45) 45%, rgba(12, 10, 32, 0) 72%);
  text-align: center;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
  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: 4px;
  text-transform: uppercase;
  color: #ffe9b0;
}

.tc-names {
  margin: 6px 0;
  font-family: 'Great Vibes', cursive;
  font-size: clamp(44px, 12vw, 78px);
  line-height: 1.15;
  color: #fff;
}

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

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

.tc-date {
  font-size: 13px;
  font-weight: 500;
  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: 7px 14px;
  border: 1px solid rgba(242, 201, 76, 0.7);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--gold);
  font-family: inherit;
  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 #chatComposer,
#gameWrap.cinema #prompt,
#gameWrap.minigame #hud,
#gameWrap.minigame #ambienceBtn,
#gameWrap.minigame #menuToggleBtn,
#gameWrap.minigame #quickMenu,
#gameWrap.minigame #questPill,
#gameWrap.minigame #socialControls,
#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: 34px;
  padding: 0 12px;
  border: 2px solid #ff8fb1;
  border-radius: 999px;
  background: var(--panel);
  color: #ffd1e0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#questPill.done {
  background: #ff6f9f;
  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(56px + env(safe-area-inset-top));
  max-width: min(86vw, 360px);
  padding: 9px 14px;
  border: 2px solid var(--gold);
  border-radius: 12px;
  background: rgba(22, 33, 62, 0.94);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 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 ease, 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, 460px);
  padding: 10px;
  border: 2px solid var(--gold);
  border-radius: 14px;
  background: rgba(22, 33, 62, 0.94);
  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 12px;
  border: 2px solid rgba(242, 201, 76, 0.5);
  border-radius: 999px;
  background: transparent;
  color: #f4f1ea;
  font-family: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.pf-chip.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--dark);
  font-weight: 700;
}

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

.pf-actions button {
  flex: 1;
  padding: 11px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  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: var(--accent);
  color: #fff;
}

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

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

.story-card.locked {
  border: 1px dashed rgba(242, 201, 76, 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);
}

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

.story-title {
  margin: 4px 0 6px;
  font-family: 'Great Vibes', cursive;
  font-size: 28px;
  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: 10px;
}

.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 #ff8fb1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.story-dots span.on {
  background: #ff6f9f;
}

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

.action-btn.story-all-btn {
  border: 2px solid var(--gold);
  background: var(--panel);
  color: var(--gold);
}
