/* =====================================================================
   JANUR: pulau pesta pernikahan 3D berhias janur kuning (ADR 018). Bagian atas berkas ini salinan styles.css
   Laguna (menu, dialog, versi ringkas tetap memakai token Laguna sampai pemilik melihat pratinjau fase A);
   latar, layar pembuka & loading Janur dari docs/design/20261113-janur-intro.md, blok 3D di bagian akhir.
   Semua animasi hias memakai transform/opacity saja supaya ringan di HP.
   ===================================================================== */
:root {
  --blush: #ffe1d2;
  --peach: #ffe9c9;
  /* palet pulau Janur (Wulan, build_pulau_janur.py) untuk latar layar pembuka */
  --sky: #bfe6f5;     /* = langit siang dunia 3D (SKY.day), juga theme-color */
  --sky-low: #dcf1f7; /* langit di cakrawala */
  --sea-1: #a3dde6;   /* pita laut terjauh */
  --sea-2: #7fcfdc;   /* WATER1 */
  --sea-3: #66c1d2;
  --sea-4: #4fb3c8;   /* WATER2 */
  --janur: #f2d65c;
  --janur-2: #ddb93e;
  --janur-3: #f7e38a;
  --sogan: #8a5a3b;   /* WOOD_D */
  --maroon: #8e2a3b;
  --foam: #fff;       /* garis cakrawala */
  --horizon: 22%;     /* tinggi, supaya pulau mini pasangan selalu di atas laut */
  --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);
  /* A3: tombol terang berlabel gelap (kontras >= 4,5:1); warna tombol tetap, ujung tergelapnya sedikit diterangkan */
  --cta-1: #ffa58c;   /* .cta (Buka Undangan, Coba lagi) */
  --cta-2: #ff7a66;
  --cta-3: #f86452;
  --cta-ink: #0e2a3c;
  --soft-1: #ffa58c;  /* tombol sekunder (Tambah ke Kalender, Unduh Foto, rana photo booth, Salin No. Rekening) */
  --soft-2: #ff7a66;
  --soft-ink: #0e2a3c;
  --on-rose: #0e2a3c;   /* ikon kirim chat */
  --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) 0%, var(--sky-low) var(--horizon), var(--sea-2) var(--horizon), var(--sea-4) 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;
}

/* =====================================================================
   LATAR LAYAR PEMBUKA & LOADING (Sekar, docs/design/20261113-janur-intro.md)
   Langit siang dunia 3D, laut berpita datar, untaian janur, dermaga menuju pulau Janur di cakrawala.
   Satu blok SVG di index.html, tanpa gambar; satu-satunya gerak: kilau air (mati saat reduced motion).
   ===================================================================== */
#skyBackdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg,
    var(--sky) 0%, var(--sky-low) var(--horizon),
    var(--foam) var(--horizon), var(--foam) calc(var(--horizon) + 2px),
    var(--sea-1) calc(var(--horizon) + 2px), var(--sea-1) calc(var(--horizon) + 6%),
    var(--sea-2) calc(var(--horizon) + 6%), var(--sea-2) calc(var(--horizon) + 22%),
    var(--sea-3) calc(var(--horizon) + 22%), var(--sea-3) calc(var(--horizon) + 42%),
    var(--sea-4) calc(var(--horizon) + 42%));
  transition: opacity 0.8s ease;
}

#skyBackdrop.hide {
  opacity: 0;
}

/* untaian janur menggantung di atas: tanda hajatan sekali lihat */
#skyBackdrop .garland { position: absolute; left: 0; top: 0; width: 100%; height: 46px; }
/* dua awan berundak, diam */
#skyBackdrop .cloud { position: absolute; height: auto; }
#skyBackdrop .c1 { left: 5%; top: 12%; width: 120px; }
#skyBackdrop .c2 { right: 6%; top: 21%; width: 84px; }
/* dermaga dari tamu ke cakrawala: tamu tiba di tempat dunia 3D dimulai */
#skyBackdrop .pier { position: absolute; left: 0; right: 0; top: var(--horizon); width: 100%; height: calc(100% - var(--horizon)); }
/* pulau Janur di cakrawala, di ujung dermaga: gapura, dua atap joglo, dua nyiur */
#skyBackdrop .isle { position: absolute; left: 50%; top: var(--horizon); width: 150px; height: auto; transform: translate(-50%, -78%); }
@media (min-width: 600px) { #skyBackdrop .isle { width: 210px; } }
/* beberapa garis kilau di air */
#skyBackdrop .shimmer i {
  position: absolute;
  height: 2px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.75);
  animation: shimmer 7s ease-in-out infinite alternate;
}
#skyBackdrop .shimmer i:nth-child(1) { left: 8%; top: calc(var(--horizon) + 8%); width: 34px; }
#skyBackdrop .shimmer i:nth-child(2) { left: 72%; top: calc(var(--horizon) + 16%); width: 26px; animation-duration: 9s; }
#skyBackdrop .shimmer i:nth-child(3) { left: 12%; top: calc(var(--horizon) + 38%); width: 46px; animation-duration: 8s; }
#skyBackdrop .shimmer i:nth-child(4) { left: 80%; top: calc(var(--horizon) + 55%); width: 40px; animation-duration: 10s; }
@keyframes shimmer { to { transform: translateX(16px); opacity: 0.35; } }
@media (max-width: 599px) {
  #skyBackdrop .c1 { left: -14px; top: 8%; width: 84px; }
  #skyBackdrop .c2 { right: -10px; top: 13%; width: 64px; }
}

/* fase B, murah disiapkan sekarang: loading malam bila dunia dimulai malam (Start menambah .night) */
#skyBackdrop.night {
  --sky: #1b2742; --sky-low: #2b3a5c; --sea-1: #2c4a68; --sea-2: #24405c; --sea-3: #1d3550; --sea-4: #172b44;
  --foam: rgba(255, 242, 196, 0.35);
}
#skyBackdrop .garland .lamp { display: none; }
#skyBackdrop.night .garland .lamp { display: inline; }
#skyBackdrop.night .cloud { opacity: 0.18; }
#skyBackdrop.night .pier, #skyBackdrop.night .isle { filter: brightness(0.5) saturate(0.85); }
#skyBackdrop.night .shimmer i { background: rgba(255, 217, 138, 0.55); }
body.night #loadingScreen { --ink: #fff2c4; --glass: rgba(27, 39, 66, 0.78); }
body.night .loading-card { border-color: rgba(255, 242, 196, 0.3); }
body.night .loading-bar-track { background: rgba(255, 255, 255, 0.18); box-shadow: inset 0 0 0 1px rgba(255, 242, 196, 0.45); }

/* =====================================================================
   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;
  /* token Janur untuk layar pembuka, form nama acara, loading, tidak ditemukan & kunci (Sekar §4) */
  --ink: #24382a;        /* tinta hijau daun, sama dengan label & prompt di pulau */
  --ink-soft: #4d5f47;
  --gold: var(--sogan);  /* "&" dan fokus input */
  --line: rgba(221, 185, 62, 0.62);
  --glass: rgba(255, 255, 255, 0.76);
  --shadow: 0 10px 30px rgba(31, 84, 98, 0.22);
  --cta-1: var(--janur-3);
  --cta-2: var(--janur);
  --cta-3: var(--janur-2);
  --cta-ink: var(--ink);
  --err: #a3261b;
}

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

.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(--maroon); /* seperti pita nama pengantin di pulau */
  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(138, 90, 59, 0.55);
}

#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: 11px; /* 9 px dengan opacity .8 hanya 3,95:1 (Sekar §5) */
  font-style: italic;
  color: var(--ink-soft);
}

#nameInput,
#slugInput {
  display: block;
  width: 100%;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--sogan);
  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(--ink);
  box-shadow: 0 0 0 3px rgba(221, 185, 62, 0.55);
}

.cta {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cta-1) 0%, var(--cta-2) 55%, var(--cta-3) 100%);
  color: var(--cta-ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(221, 185, 62, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -2px 0 rgba(138, 90, 59, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.3s ease;
  isolation: isolate; /* kilau (::after, z-index -1) di atas latar tombol, di bawah labelnya */
}

.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;
  z-index: -1;
}

@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(221, 185, 62, 0.4);
}

.cta:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

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


/* pelaminan Janur (render 3D Wulan) di atas pulau pasir mini low-poly, 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: 44%;
  width: 140%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.35) 38%, rgba(255, 255, 255, 0) 64%);
}

.hero-isle {
  position: relative;
  padding-bottom: 10%;
}

.hero-isle img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto 7 / 6; /* ruang sudah disiapkan sebelum gambar dimuat */
  image-rendering: auto; /* render 3D diperkecil: `pixelated` (2D) membuat tepinya bergerigi */
}

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

.hero-base {
  position: absolute;
  z-index: 1;
  left: -2%;
  width: 104%;
  top: 34%;
  height: auto;
}

/* tengah bila muat, bisa digulir dari atas bila tidak (360x640 dengan nama tamu; `center` memotong atasnya) */
#intro {
  justify-content: flex-start;
}

#intro > .intro-hero {
  margin-top: auto;
}

#intro > .intro-card {
  margin-bottom: auto;
}

/* =====================================================================
   LAYAR LOADING: kartu kaca kecil di atas dermaga (teks tidak pernah di atas papan & air)
   ===================================================================== */
#loadingScreen {
  z-index: 55;
}

.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(84vw, 320px);
  padding: 18px 20px 22px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* janur kuning melengkung dengan rumbai yang berayun pelan */
.loading-janur {
  width: 48px;
  height: 69px;
  margin-bottom: 12px;
  overflow: visible;
}

.loading-janur .tassel {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: tassel 2.6s ease-in-out infinite alternate;
}

@keyframes tassel {
  from { transform: rotate(-6deg); }
  to { transform: rotate(6deg); }
}

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

.loading-bar-track {
  width: 100%;
  height: 14px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 0 0 1px rgba(138, 90, 59, 0.35);
}

/* anyaman janur: garis miring sogan di atas dua warna janur, bertepi sogan supaya terbaca di atas lintasannya */
.loading-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background:
    repeating-linear-gradient(135deg, rgba(138, 90, 59, 0.22) 0 3px, transparent 3px 7px),
    linear-gradient(180deg, var(--janur) 0 55%, var(--janur-2) 55%);
  box-shadow: inset 0 0 0 1.5px var(--sogan);
  transition: width 0.2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .loading-janur .tassel,
  #skyBackdrop .shimmer i {
    animation: none;
  }
}

/* =====================================================================
   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;
}

/* menu terbuka: emas dengan ✕ gelap (✕ putih di atas warna aksen kurang kontras) */
#menuToggleBtn[aria-expanded="true"] {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  border-color: #fff;
  color: var(--ink);
}

/* UX-1 (docs/design/20261028-ronde-rapi.md §2): satu panel buram, sama di kelima tema (hanya token tema).
   Tanpa backdrop-filter di atas kanvas; kontrasnya sama siang dan malam. */
#quickMenu {
  position: absolute;
  z-index: 21; /* di atas #socialControls, #zoomControls, #questPill (20); di bawah #wishCard (22) & #toast (24) */
  top: calc(114px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  width: min(340px, calc(100vw - 28px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-height: calc(100% - 134px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-solid);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(246, 217, 138, 0.5) transparent;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

#quickMenu.open {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  transform: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0s;
}

/* 4 tombol besar 2 x 2; bila ganjil, yang terakhir selebar dua kolom */
.qm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.qm-grid > :last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.qm-tile,
.qm-row,
.qm-item {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: #fdf6ea;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.qm-tile {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  border: 1.5px solid color-mix(in srgb, var(--gold-2) 45%, transparent);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

.qm-ico {
  font-size: 24px;
  line-height: 1;
}

/* baris selebar panel: Versi ringkas, Musik, Lainnya, item pesan di pratinjau */
.qm-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--gold-2) 30%, transparent);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
}

/* musik / efek suara sedang menyala, dan item pesan di pratinjau (Ide 2): emas, huruf gelap */
.qm-row.on,
.qm-item.on,
.qm-order {
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  color: var(--ink);
  font-weight: 600;
}

.qm-more {
  justify-content: space-between;
  font-weight: 600;
}

.qm-chev::after {
  content: '▾';
  font-size: 16px;
}

.qm-more[aria-expanded="true"] .qm-chev::after {
  content: '▴';
}

/* daftar "Lainnya": baris biasa bergaris pemisah, terbuka di bawah tombolnya */
.qm-list {
  display: flex;
  flex-direction: column;
  margin-top: -2px;
  border-top: 1px solid color-mix(in srgb, var(--gold-2) 25%, transparent);
}

.qm-list[hidden] {
  display: none;
}

.qm-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--gold-2) 18%, transparent);
  border-radius: 0;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
}

.qm-item:last-child {
  border-bottom: none;
}

.qm-item.on {
  border-radius: 12px;
}

.qm-tile:active,
.qm-row:active,
.qm-item:active {
  background: color-mix(in srgb, var(--gold-2) 22%, transparent);
}

.qm-row.on:active,
.qm-item.on:active,
.qm-order:active {
  background: var(--gold);
}

.qm-tile:focus-visible,
.qm-row:focus-visible,
.qm-item:focus-visible,
#menuToggleBtn:focus-visible {
  outline: 3px solid var(--gold-2);
  outline-offset: 2px;
}

/* di dalam daftar cincin fokusnya ke dalam, supaya tidak terpotong tepi panel */
.qm-item:focus-visible {
  outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
  #quickMenu,
  #quickMenu.open {
    transform: none;
    transition: visibility 0s;
  }
}

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

#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: var(--on-rose);
  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: #06301a;
  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, var(--soft-1), var(--soft-2));
  color: var(--soft-ink);
  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 {
  min-height: 44px;
  margin-top: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--soft-1), var(--soft-2));
  color: var(--on-rose);
  font-size: 13px;
  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 #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: 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: var(--soft-ink);
}

#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, var(--soft-1), var(--soft-2));
  color: var(--soft-ink);
}

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

/* =====================================================================
   UNDANGAN TIDAK DITEMUKAN / BELUM BISA DIMUAT (showLoadProblem() di script.js)
   Kartu .intro-card yang sama dengan form nama acara, di tengah layar, di atas latar
   layar pembuka. Judul huruf serif (bukan script) supaya terbaca sekilas.
   ===================================================================== */
#loadProblem h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

#loadProblem p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
}

#loadProblem p + p {
  margin-top: 8px;
}

/* baris terakhir tidak tinggal satu kata ("bisa dimuat", bukan "dimuat" sendirian) */
#loadProblem h1,
#loadProblem p {
  text-wrap: balance;
}

#loadProblem .cta {
  min-height: 44px;
  margin-top: 16px;
}

/* =====================================================================
   LAYAR KUNCI KATA SANDI (products SPEC §20, docs/design/20261028-link-privat.md §3.2 & §7.1;
   showLockScreen() di script.js). Kartu .intro-card yang sama dengan #loadProblem, di atas latar
   layar pembuka. Sama persis di kelima tema: warnanya dari token tema.
   ===================================================================== */
#lockScreen {
  justify-content: flex-start; /* kartu yang lebih tinggi dari layar (320 px) tetap bisa digulir dari judulnya */
}

#lockScreen .intro-card {
  margin: auto 0; /* di tengah selama muat */
}

#lockScreen h1 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
  overflow-wrap: anywhere; /* teks diperbesar: kata panjang patah, tidak terpotong */
}

#lockScreen .lock-guest {
  margin: 0 auto 12px;
  padding: 8px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px dashed var(--line);
  border-color: color-mix(in srgb, var(--rose) 45%, transparent);
}

#lockScreen .lock-guest .lbl {
  display: block;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  color: color-mix(in srgb, var(--ink) 50%, var(--ink-soft));
}

#lockScreen .lock-guest .nm {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

#lockScreen .lead {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  text-wrap: pretty; /* L11: tanpa "ini." sendirian di awal baris */
}

#lockScreen label {
  display: block;
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

#lockInput {
  display: block;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--ink-soft); /* netral: merah hanya untuk salah (L8/L9) */
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font: 500 18px/1.3 'Poppins', sans-serif;
  text-align: center;
  outline: none;
}

#lockInput:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(212, 162, 76, 0.55);
}

#lockInput[aria-invalid="true"] {
  border: 2px solid #8b2635;
}

#lockMsg {
  margin: 8px 0 14px;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  color: color-mix(in srgb, var(--ink) 50%, var(--ink-soft));
  text-wrap: balance;
}

#lockMsg.is-error {
  color: #8b2635;
  font-weight: 500;
}

#lockScreen .cta {
  min-height: 52px;
  font-size: 17px;
}

/* sesudah buka kunci fokus pindah ke nama pengantin (bukan tombol): tanpa cincin fokus */
#introNames[tabindex="-1"]:focus {
  outline: none;
}

/* =====================================================================
   KREDIT INVITECRAFT (products SPEC §10 P8, docs/design/20261021-kredit-invitecraft.md)
   Satu baris kecil di kaki kartu pembuka, di bawah keterangan tombol Buka Undangan.
   Sama persis di kelima tema: warnanya dihitung dari token --ink dan --ink-soft milik tema.
   ===================================================================== */
#intro .made-by,
#lockScreen .made-by {
  display: block;
  width: fit-content;
  margin: 0 auto -6px;          /* bawah -6px: area ketuk boleh masuk ke padding kartu */
  padding: 13px 12px;           /* baris 18px + 2 x 13px = area ketuk 44px */
  border-radius: 12px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 400;
  color: var(--ink);            /* browser tanpa color-mix(): warna teks kartu */
  color: color-mix(in srgb, var(--ink) 50%, var(--ink-soft)); /* >= 5,2:1 di kelima tema */
  text-decoration: none;
  animation-delay: 1.5s;        /* muncul paling akhir, setelah semua isi kartu */
}

#intro .made-by .brand,
#lockScreen .made-by .brand {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

#intro .made-by:hover,
#intro .made-by:active,
#lockScreen .made-by:hover,
#lockScreen .made-by:active {
  color: var(--ink);
}

#intro .made-by:hover .brand,
#intro .made-by:active .brand,
#lockScreen .made-by:hover .brand,
#lockScreen .made-by:active .brand {
  text-decoration-thickness: 2px;
}

#intro .made-by:focus-visible,
#lockScreen .made-by:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;        /* ring di dalam area ketuk, tidak menyentuh keterangan di atasnya */
}

/* teks untuk pembaca layar saja */
#intro .made-by .sr-only,
#lockScreen .made-by .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* =====================================================================
   KETERANGAN KARTU PEMBUKA LEBIH GELAP (CR-1, docs/design/20261021-kredit-invitecraft.md §9)
   --ink-soft saja hanya 3,5–4,3:1 di empat tema (gagal AA). Campuran yang sama dengan kredit
   Invitecraft memberi >= 5,1:1. Ikut berlaku untuk keterangan form nama acara (#slugPrompt).
   ===================================================================== */
.intro-card .hint { color: color-mix(in srgb, var(--ink) 50%, var(--ink-soft)); }

/* ===== Ide 2: pratinjau "Coba dengan nama kalian" (hanya ?w=default&pria=..&wanita=.., body.is-preview) ===== */
body.is-preview { --pv-h: calc(28px + env(safe-area-inset-top, 0px)); }
#previewBar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 95;
  box-sizing: border-box;
  height: var(--pv-h);
  padding: env(safe-area-inset-top, 0px) 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-solid);
  color: var(--gold-2);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}
#previewBar b { font-weight: 700; letter-spacing: 0.08em; margin-right: 0.35em; }
/* semua layar mulai di bawah bar, jadi bar tidak menutupi apa pun (Phaser RESIZE mengikuti #phaserContainer) */
body.is-preview .screen,
body.is-preview #gameWrap,
body.is-preview #tutorialOverlay,
body.is-preview #modalOverlay { top: var(--pv-h); }
/* joystick diletakkan di koordinat jari (clientY), sedangkan #gameWrap turun setinggi bar */
body.is-preview #joystickBase { margin-top: calc(-1 * var(--pv-h)); }
body.is-preview #chatToggleBtn,
body.is-preview #chatComposer { display: none !important; }
body.is-preview #introGuest > :not(.pv-intro) { display: none; }
.pv-intro { font-size: 11px; line-height: 1.5; color: var(--ink); }
.pv-intro b { font-weight: 600; }
.pv-sample {
  margin: 0 0 12px;
  padding: 7px 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--gold-2);
}
.pv-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  vertical-align: 1px;
}
body.is-preview form button:disabled { opacity: 0.6; cursor: not-allowed; }

/* =====================================================================
   VERSI RINGKAS TANPA GAME (Ide 4, docs/design/20261024-ide-1-4.md §6)
   Tombol teks di kartu pembuka + satu halaman penuh (#compactView). Siang: kertas foto tema dan --ink;
   malam: --panel-solid. Teks 18px (paling kecil 16px, kecuali kredit 14px), tombol 52px, kontras >= 4,5:1
   di kedua mode. Tidak memakai .action-btn (CR-T4). Satu-satunya nilai yang berbeda per tema: --cv-paper.
   ===================================================================== */
#compactBtn {
  display: block;
  min-height: 44px;
  margin: 8px auto -2px;
  padding: 10px 14px;
  border: none;
  border-radius: 12px;
  background: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  color: color-mix(in srgb, var(--ink) 50%, var(--ink-soft)); /* warna kredit P8 */
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
#compactBtn:disabled { cursor: default; }
#compactBtn:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

#compactView {
  --cv-paper: #fbf5e9; /* kertas foto tema */
  --cv-bg: var(--cv-paper);
  --cv-text: var(--ink);
  --cv-sub: color-mix(in srgb, var(--ink) 50%, var(--ink-soft));
  --cv-head: var(--ink);
  --cv-card: color-mix(in srgb, #fff 60%, var(--cv-paper));
  --cv-line: color-mix(in srgb, var(--ink) 18%, transparent);
  --cv-btn: var(--ink);
  --cv-btn-text: #fff;
  --cv-focus: var(--ink);
  --cv-err: #a3261b;
  position: fixed;
  inset: 0;
  z-index: 90; /* di atas dialog (60), di bawah bar pratinjau (95) */
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--cv-bg);
  color: var(--cv-text);
  color-scheme: light;
  font-size: 18px;
  line-height: 1.6;
  overflow-wrap: anywhere; /* "Bapak/Ibu/Saudara/i" & nama panjang tetap muat dengan teks 200% */
  animation: cvIn 0.2s ease-out;
}
#compactView.cv-night {
  --cv-bg: var(--panel-solid);
  --cv-text: #fdf6ea;
  --cv-sub: color-mix(in srgb, #fdf6ea 78%, var(--panel-solid));
  --cv-head: var(--gold-2);
  --cv-card: color-mix(in srgb, #fff 6%, var(--panel-solid));
  --cv-line: color-mix(in srgb, var(--gold-2) 35%, transparent);
  --cv-btn: var(--gold-2);
  --cv-btn-text: var(--panel-solid);
  --cv-focus: var(--gold-2);
  --cv-err: #ffb4a8;
  color-scheme: dark;
}
@keyframes cvIn {
  from { opacity: 0; transform: translateY(16px); }
}
/* kurangi gerakan: langsung tampil (animasi 0,01ms tetap sempat menahan opacity 0 beberapa frame) */
@media (prefers-reduced-motion: reduce) {
  #compactView { animation: none; }
}
#compactView :focus-visible { outline: 3px solid var(--cv-focus); outline-offset: 2px; }
#compactView [tabindex="-1"]:focus { outline: none; }
#compactView p { margin: 0; }
#compactView .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

#compactView .cv-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
  padding: env(safe-area-inset-top, 0px) max(8px, calc(50% - 272px)) 0;
  border-bottom: 1px solid var(--cv-line);
  background: var(--cv-bg);
}
#compactView .cv-back {
  min-height: 44px;
  padding: 0 12px;
  border: none;
  border-radius: 12px;
  background: none;
  color: var(--cv-text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
#compactView .cv-icons { display: flex; gap: 8px; }
#compactView .cv-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--cv-line);
  border-radius: 50%;
  background: var(--cv-card);
  color: var(--cv-text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
#compactView .cv-icon[aria-pressed="true"] { border: 2px solid var(--cv-text); }

#compactView .cv-main {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px calc(32px + env(safe-area-inset-bottom, 0px));
}
#compactView .cv-sec { scroll-margin-top: 64px; }
#compactView .cv-sec + .cv-sec { margin-top: 32px; }
#compactView h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--cv-head);
}
#compactView h3 { margin: 0 0 4px; font-size: 20px; font-weight: 600; line-height: 1.3; }
#compactView .cv-sub { font-size: 16px; color: var(--cv-sub); }
#compactView .cv-note { margin-bottom: 12px; }

#compactView .cv-cover { text-align: center; }
#compactView .cv-bismillah {
  margin-bottom: 8px;
  font-family: var(--arabic);
  font-size: 24px;
  line-height: 1.6;
  color: var(--cv-head);
}
#compactView .cv-kicker {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cv-sub);
}
#cvNames {
  margin: 4px 0;
  font-family: var(--script);
  font-size: 52px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--cv-head);
}
#compactView .cv-date { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.3; }
#compactView .cv-chip {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 14px;
  border: 1px solid var(--cv-line);
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
}
#compactView .cv-guest {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px dashed var(--cv-line);
  border-radius: 14px;
  background: var(--cv-card);
  font-size: 16px;
}
#compactView .cv-guest b {
  display: block;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}
#compactView .cv-jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0; }
#compactView .cv-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--cv-line);
  border-radius: 999px;
  background: var(--cv-card);
  color: var(--cv-text);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

#compactView .cv-card {
  padding: 16px;
  border: 1px solid var(--cv-line);
  border-radius: 16px;
  background: var(--cv-card);
}
#compactView .cv-card + .cv-card { margin-top: 12px; }
#compactView dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 8px 0 0; }
#compactView dd { margin: 0; font-weight: 600; }
#compactView dd .cv-sub { display: block; font-weight: 400; }
#compactView .cv-timeline { margin: 0; padding: 0; list-style: none; }
#compactView .cv-timeline li { display: flex; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--cv-line); }
#compactView .cv-timeline b { flex: none; min-width: 56px; font-variant-numeric: tabular-nums; }
#compactView .cv-number {
  margin-top: 2px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}
#compactView .cv-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  padding: 10px 16px;
  border: 2px solid var(--cv-btn);
  border-radius: 999px;
  background: var(--cv-btn);
  color: var(--cv-btn-text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
#compactView .cv-btn.ghost { border-color: var(--cv-line); background: transparent; color: var(--cv-text); }
#compactView .cv-end { text-align: center; }
#compactView .made-by {
  display: inline-block;
  margin-top: 16px;
  padding: 13px 12px; /* baris 18px + 2 x 13px = area ketuk 44px */
  font-size: 14px;
  line-height: 18px;
  color: var(--cv-sub);
  text-decoration: none;
}
#compactView .made-by .brand { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* sampel pratinjau (Ide 2) di halaman ini */
#compactView .pv-sample { margin: 0 0 12px; border-color: var(--cv-line); font-size: 16px; color: var(--cv-text); }
#compactView .pv-chip { border-color: var(--cv-line); font-size: 16px; }
body.is-preview #compactView { top: var(--pv-h); }
body.is-preview #compactView .cv-bar { padding-top: 0; }

/* game & layar di belakangnya diam selama halaman ini terbuka (hemat baterai HP lama) */
body.cv-open > :not(#compactView),
body.cv-open > :not(#compactView) *,
body.cv-open > :not(#compactView) *::before,
body.cv-open > :not(#compactView) *::after { animation-play-state: paused; }

/* ---------- Form RSVP bersama: status 3 pilihan tanpa bawaan, jumlah orang − [n] +, pesan error ---------- */
.rsvp-form {
  --rf-text: #fff;
  --rf-line: color-mix(in srgb, var(--gold-2) 35%, transparent);
  --rf-card: rgba(255, 255, 255, 0.07);
  --rf-on: var(--gold-2);
  --rf-err: #ffb4a8;
}
.rsvp-form fieldset { min-width: 0; margin: 12px 0 0; padding: 0; border: none; }
.rsvp-form legend { margin: 0 0 5px; padding: 0; font-size: 11px; color: var(--gold-2); }
.rsvp-form .rsvp-radio {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  margin: 0 0 8px;
  padding: 6px 14px;
  border: 2px solid var(--rf-line);
  border-radius: 12px;
  background: var(--rf-card);
  color: var(--rf-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.rsvp-form .rsvp-radio:has(input:checked) { border-color: var(--rf-on); }
.rsvp-form .rsvp-radio input { flex: none; width: 22px; height: 22px; margin: 0; padding: 0; accent-color: var(--rf-on); }
#modalBox .rsvp-radio input { color-scheme: dark; }
.rsvp-form .rsvp-radio input:focus { box-shadow: none; }
.rsvp-form .rsvp-radio input:focus-visible { outline: 2px solid var(--rf-on); outline-offset: 2px; }
.rsvp-form .rsvp-stepper {
  display: flex;
  width: fit-content;
  max-width: 100%;
  border: 2px solid var(--rf-line);
  border-radius: 12px;
  overflow: hidden;
}
.rsvp-form .rsvp-stepper button {
  flex: none;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: var(--rf-card);
  color: var(--rf-text);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
}
.rsvp-form .rsvp-stepper input {
  flex: 0 1 64px;
  min-width: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--rf-text);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.rsvp-form .rsvp-stepper input::-webkit-inner-spin-button,
.rsvp-form .rsvp-stepper input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.rsvp-form .rsvp-stepper :focus-visible { outline: 3px solid var(--rf-on); outline-offset: -3px; }
.rsvp-form .rsvp-help { margin: 6px 0 0; font-size: 11px; opacity: 0.85; }
.rsvp-form .rsvp-err { margin: 6px 0 0; font-size: 12px; font-weight: 600; color: var(--rf-err); }
.rsvp-form .rsvp-done {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 2px solid #25d366;
  border-radius: 14px;
  background: var(--rf-card);
  color: var(--rf-text);
  font-size: 13px;
  line-height: 1.6;
}
.rsvp-form .rsvp-done:empty { display: none; }
.rsvp-form .rsvp-done a { color: inherit; font-weight: 600; }

/* form yang sama di halaman versi ringkas: huruf 16-18px, warna halaman */
#compactView .rsvp-block > p { font-size: 16px; color: var(--cv-sub); }
#compactView .rsvp-block > .note { margin-top: 8px; opacity: 1; }
#compactView .rsvp-form {
  --rf-text: var(--cv-text);
  --rf-line: var(--cv-line);
  --rf-card: var(--cv-card);
  --rf-on: var(--cv-text);
  --rf-err: var(--cv-err);
}
#compactView .rsvp-form > label,
#compactView .rsvp-count > label,
#compactView .rsvp-form legend { margin: 16px 0 6px; font-size: 16px; font-weight: 600; color: var(--cv-text); }
#compactView .rsvp-form fieldset { margin-top: 16px; }
#compactView .rsvp-form legend { margin-top: 0; }
#compactView .rsvp-form input[type="text"],
#compactView .rsvp-form textarea {
  min-height: 52px;
  padding: 12px 14px;
  border: 2px solid var(--cv-sub);
  background: var(--cv-card);
  color: var(--cv-text);
  font-size: 18px;
}
#modalBox .rsvp-form input[type="text"] { min-height: 44px; }
#compactView .rsvp-form input:focus,
#compactView .rsvp-form textarea:focus { border-color: var(--cv-text); box-shadow: none; }
#compactView .rsvp-form ::placeholder { color: var(--cv-sub); opacity: 1; }
#compactView .rsvp-form .rsvp-radio { font-size: 18px; }
#compactView .rsvp-form .rsvp-stepper { border-color: var(--cv-sub); }
#compactView .rsvp-form .rsvp-stepper input { font-size: 20px; }
#compactView .rsvp-form .rsvp-stepper :focus-visible { outline-offset: -3px; }
#compactView .rsvp-form .rsvp-help,
#compactView .rsvp-form .rsvp-err { margin-top: 6px; font-size: 16px; opacity: 1; }
#compactView .rsvp-form .rsvp-done { margin-top: 12px; font-size: 16px; }
#compactView .rsvp-form .rsvp-help { color: var(--cv-sub); }
#compactView .rsvp-send {
  min-height: 52px;
  margin-top: 16px;
  padding: 10px 16px;
  background: #25d366;
  color: #06301a;
  font-size: 18px;
  font-weight: 600;
  box-shadow: none;
}

/* Kartu pembuka sedikit lebih rapat di layar pendek (M-1, Ide 4): tombol "Versi ringkas" menambah ~50px.
   Hanya jarak di dalam kartu; ukuran huruf, tombol & area ketuk tetap. Padding kartu hanya dikurangi bila
   tidak ada lambang (.crest) di pucuknya: Sakura & Sakinah butuh ruang atasnya (lambang menjorok 24px). */
@media (max-height: 940px) {
  #intro .intro-card:not(:has(.crest)) { padding-top: 18px; padding-bottom: 14px; }
  #intro .names { margin-top: 2px; margin-bottom: 0; }
  #intro .intro-date { margin-bottom: 8px; }
  #introGuest { margin-bottom: 8px; padding-top: 6px; padding-bottom: 6px; }
  #introGuest .guest-salam { margin-bottom: 2px; }
  #introGuest .guest-name { margin: 1px 0; }
  #nameInput { margin-bottom: 10px; }
  #intro .hint { margin-top: 4px; }
  #intro .bismillah { margin-top: 4px; margin-bottom: 2px; }
}

/* =====================================================================
   TEMA 3D (Janur, ADR 018): semua aturan khusus 3D ada di blok ini; bagian di atasnya salinan styles.css Laguna.
   Label di pulau, prompt pintu, petunjuk jalan/lari & cincin joystick: docs/design/20261113-tema-3d.md §3 (Sekar).
   Token Sekar dipakai untuk pratinjau fase A (tampilan hijau daun); token Laguna lainnya tetap sampai pemilik melihatnya.
   ===================================================================== */
:root {
  --label-bg: rgba(36, 56, 42, 0.88);
  --hint-bg: rgba(36, 56, 42, 0.86);
  --prompt-1: rgba(36, 56, 42, 0.94);
  --prompt-2: rgba(58, 84, 52, 0.94);
  --names-ink: #8e2a3b;
  --names-bg: rgba(255, 250, 244, 0.92);
  --ring-out: #8a5a3b;
  --ring-in: #f2d65c;
  /* tinggi tombol emoji + chat di kiri bawah (40 + 8 + 52) dan jaraknya ke tepi; prompt & petunjuk duduk di atasnya */
  --social-top: calc(18px + 100px + 12px + env(safe-area-inset-bottom));
}

#phaserContainer canvas.world3d {
  display: block;
  width: 100%;
  height: 100%;
}

/* nama pengantin di dekat pelaminan (dalam 6,5 m) */
.names3d {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  margin: 0;
  padding: 6px 18px;
  border-radius: 999px;
  background: var(--names-bg);
  color: var(--names-ink);
  font: 600 22px/1.2 'Cormorant Garamond', serif;
  white-space: nowrap;
  max-width: 80vw;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  will-change: transform;
}

.names3d[hidden] {
  display: none;
}

/* label nama tempat di pulau: span DOM tanpa draw call, tidak bisa diketuk (geser di mana saja tetap jalan) */
#labels3d {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.label3d {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 60vw;
  padding: 3px 11px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--label-bg);
  color: #fff;
  font: 600 13px/1.35 'Poppins', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  will-change: transform;
}

.label3d[hidden] {
  display: none;
}

/* prompt pintu: teks 2D sama, tapi minimal 44 px tinggi & di atas tombol emoji/chat (tidak menimpa lagi).
   Di HP sempit teksnya dua baris, nama tempat utuh di baris kedua (updatePrompt di script.js menaruh ganti barisnya;
   white-space: pre = tetap tanpa bungkus otomatis, jadi lebar pil mengikuti baris terpanjang) */
#gameWrap #prompt {
  bottom: var(--social-top);
  min-height: 44px;
  padding: 11px 18px;
  background: linear-gradient(135deg, var(--prompt-1), var(--prompt-2));
  font-size: 13px;
  line-height: 20px;
  white-space: pre;
  text-align: center;
  touch-action: manipulation;
}

/* petunjuk jalan/lari kunjungan pertama: di tempat prompt, menunggu selama prompt pintu tampil */
.walk-hint {
  position: absolute;
  left: 50%;
  bottom: var(--social-top);
  z-index: 6;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--hint-bg);
  border: 1px solid var(--line);
  color: #fff;
  font: 500 13px/1.4 'Poppins', sans-serif;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.walk-hint[hidden],
.walk-hint.under-prompt {
  display: none;
}

/* joystick: lingkaran tipis di batas jalan/lari (RUN_FROM 0,7 x 42 px = 29 px dari tengah);
   saat dorongan masuk wilayah lari, cincinnya emas dan menebal (tidak hanya warna yang berubah) */
#joystickBase::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 59px;
  height: 59px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.55);
  transform: translate(-50%, -50%);
}

#joystickBase.is-run {
  border: 3px solid var(--gold-2);
}

/* pulau tidak bisa jalan di HP ini (CR 4): tombol masuk pulau & kolom nama disembunyikan, versi ringkas yang dipakai;
   #introHintText berganti TEXT.introHintBroken */
.world-broken #startBtn,
.world-broken #nameInput,
.world-broken #compactView [data-cv="island"] {
  display: none;
}

/* setelah gagal: satu-satunya penjelasan di kartu, jadi sebesar teks loading (Sekar 20261114-janur-fallback-copy.md §3.1) */
.world-broken #introHintText {
  font-size: 13px;
  line-height: 1.5;
}

/* catatan di atas versi ringkas yang dibuka karena pulau gagal (Sekar §3.1); ukuran & warna dari .cv-sub */
#compactView #cvBrokenNote {
  margin-bottom: 16px;
  text-align: center;
}

/* selama konteks WebGL dikembalikan, tidak ada yang bisa bergerak: petunjuk jalan & prompt pintu tidak tampil (§3.2) */
#gameWrap.restoring #walkHint,
#gameWrap.restoring #prompt {
  visibility: hidden;
}

/* jalan keluar di kartu loading, muncul 8 dtk setelah Buka Undangan (Sekar §3.3). Ruang tombol disiapkan sejak awal
   (margin bawah kartu), jadi saat tombol muncul kartu hanya tumbuh ke bawah: 6 + 44 - 12 padding = 38 px */
.loading-card {
  margin-bottom: 38px;
}

.loading-card.can-skip {
  margin-bottom: 0;
  padding-bottom: 10px;
}

#loadingCompactBtn {
  display: block;
  min-height: 44px;
  margin: 6px auto 0;
  padding: 10px 14px;
  border: none;
  border-radius: 12px;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink); /* bukan campuran #compactBtn: 2,98:1 di kartu malam */
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
  animation: skip-in 0.2s ease-out;
}

#loadingCompactBtn[hidden] {
  display: none;
}

#loadingCompactBtn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

@keyframes skip-in {
  from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #loadingCompactBtn { animation: none; }
}

/* fase A: emoji & chat belum tampil di pulau (posisi tamu di Firebase menyusul di fase B), jadi tombolnya belum ada */
#gameWrap #socialControls {
  display: none;
}
