/* =====================================================================
   TOBA — pulau di danau dataran tinggi (products SPEC §30). Panel & tombol = tiga warna gorga (Sekar, cek greybox §7):
   panel kayu hitam, kartu putih tanah liat, merah gorga hanya sebagai isian, benang emas ulos untuk garis & pilihan.
   Semua animasi hias memakai transform/opacity saja supaya ringan di HP.
   ===================================================================== */
:root {
  --sky-1: #d9e9f1;   /* langit pagi (atas) */
  --sky-2: #a7cadc;   /* langit pagi dekat cakrawala */
  --blush: #ffe1d2;
  --peach: #ffe9c9;
  --sea-1: #3f86ad;   /* danau dekat tepi */
  --sea-2: #1f5f8b;   /* danau dalam */
  --ink: #2a1f1a;
  --ink-soft: #6b4d3c;
  --gold: #c9a24a;    /* benang emas ulos */
  --gold-2: #ecd38f;
  --rose: #a5352a;    /* merah gorga: hanya isian, bukan warna teks di panel gelap */
  --rose-2: #e8a294;
  --maroon: #8e2b22;  /* teks merah di kartu terang */
  --panel: rgba(36, 26, 21, 0.94);
  --panel-solid: #2b201b;
  --glass: rgba(250, 246, 238, 0.84);
  --glass-dark: rgba(36, 26, 21, 0.72);
  --line: rgba(201, 162, 74, 0.6);
  --shadow: 0 10px 30px rgba(30, 20, 15, 0.28);
  /* tombol utama merah gorga berlabel terang (kontras >= 5,2:1, pola .cta gelap Sakinah yang diterima A3) */
  --cta-1: #b5443a;   /* .cta (Buka Undangan, Coba lagi) */
  --cta-2: #a5352a;
  --cta-3: #8e2b22;
  --cta-ink: #fdf8ef;
  --soft-1: #ead08a;  /* tombol sekunder emas (Tambah ke Kalender, Unduh Foto, rana photo booth, Salin No. Rekening) */
  --soft-2: #c9a24a;
  --soft-ink: #2a1f1a;
  --on-rose: #fff8ee;   /* ikon kirim chat di atas merah */
  --script: 'Great Vibes', cursive;
  --serif: 'Cormorant Garamond', Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 44%, var(--sea-1) 56%, var(--sea-2) 100%);
  font-family: 'Poppins', sans-serif;
  color: #f4f1ea;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}

button {
  font-family: inherit;
}

#errorBanner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: #c0392b;
  color: #fff;
  padding: 10px 14px;
  font-size: 11px;
  word-break: break-word;
  line-height: 1.5;
}

/* =====================================================================
   PEMANDANGAN DANAU PAGI (layar pembuka & loading)
   Langit pagi yang sejuk, bukit hijau di seberang danau, riak air yang
   bergeser pelan. Tanpa gambar, hanya transform/opacity untuk animasinya.
   ===================================================================== */
#skyBackdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(180deg, #d9e9f1 0%, #bcd8e6 34%, #a7cadc 56%);
  transition: opacity 0.8s ease;
}

#skyBackdrop.hide {
  opacity: 0;
}

#skyBackdrop .sea {
  position: absolute;
  left: 0;
  right: 0;
  top: 56%;
  bottom: 0;
  background: linear-gradient(180deg, #4f94b8 0%, #3f86ad 22%, #2a6f9c 58%, #1f5f8b 100%);
  box-shadow: inset 0 2px 0 rgba(236, 246, 250, 0.7);
}

/* riak: garis putus-putus putih yang bergeser pelan (makin dekat makin besar) */
#skyBackdrop .swell {
  position: absolute;
  left: -60px;
  right: -60px;
  height: 2px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.45) 0 16px, transparent 16px 52px);
  animation: swell 9s linear infinite;
}

#skyBackdrop .s1 { top: 18%; opacity: 0.55; }
#skyBackdrop .s2 { top: 42%; animation-duration: 7s; animation-direction: reverse; height: 3px; }
#skyBackdrop .s3 { top: 70%; animation-duration: 5.5s; height: 3px; opacity: 0.8; }
#skyBackdrop .s4 { top: 88%; animation-duration: 6.5s; animation-direction: reverse; height: 4px; opacity: 0.7; }

@keyframes swell {
  to { transform: translateX(52px); }
}

/* garis bukit jauh di seberang danau (tanpa nama), lalu Bukit Pinus di kiri layar */
#skyBackdrop .hills {
  position: absolute;
  left: 0;
  bottom: 44%;
  display: block;
  width: 100%;
  height: 7vh;
}

#skyBackdrop .bukit {
  position: absolute;
  left: -2%;
  bottom: 44%;
  display: block;
  width: min(80vw, 720px, 95vh); /* 95vh: di HP mendatar bukit tidak memenuhi langit */
  height: auto;
  aspect-ratio: 600 / 190;
}

/* ruma beratap pelana (siluet samping dari model render Wulan) dan pinus di kaki Bukit Pinus */
#skyBackdrop .huta {
  position: absolute;
  left: calc(min(80vw, 720px, 95vh) * 0.08);
  bottom: calc(44% - 3px);
  width: clamp(96px, min(17vw, 32vh), 200px);
  aspect-ratio: 200 / 175;
}

#skyBackdrop .huta svg {
  position: absolute;
  bottom: 0;
  display: block;
  height: auto;
}

#skyBackdrop .huta .ruma {
  z-index: 1;
  left: 0;
  width: 64%;
  aspect-ratio: 162 / 214;
}

#skyBackdrop .huta .pinus {
  right: 0;
  width: 50%;
  aspect-ratio: 40 / 70;
}

/* solu (perahu kayu) yang mengayun pelan di danau */
#skyBackdrop .solu {
  position: absolute;
  right: 8%;
  top: 76%;
  display: block;
  width: clamp(96px, 16vw, 190px);
  height: auto;
  aspect-ratio: 100 / 42;
  animation: soluBob 4.6s ease-in-out infinite;
}

@keyframes soluBob {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50% { transform: translateY(-4px) rotate(1.2deg); }
}

/* =====================================================================
   LAYAR PEMBUKA
   ===================================================================== */
.screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  text-align: center;
  overflow-y: auto;
}

.intro-card {
  position: relative;
  width: min(92vw, 400px);
  padding: 26px 22px 20px;
  border-radius: 26px;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ink);
}

.intro-card::before {
  /* bingkai emas tipis di dalam kartu */
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 20px;
  border: 1px solid var(--line);
  pointer-events: none;
}

.intro-card>* {
  opacity: 0;
  animation: riseIn 0.8s cubic-bezier(.2, .8, .2, 1) forwards;
}

.intro-card>*:nth-child(1) { animation-delay: 0.15s; }
.intro-card>*:nth-child(2) { animation-delay: 0.3s; }
.intro-card>*:nth-child(3) { animation-delay: 0.45s; }
.intro-card>*:nth-child(4) { animation-delay: 0.6s; }
.intro-card>*:nth-child(5) { animation-delay: 0.75s; }
.intro-card>*:nth-child(6) { animation-delay: 0.9s; }
.intro-card>*:nth-child(7) { animation-delay: 1.05s; }
.intro-card>*:nth-child(8) { animation-delay: 1.2s; }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #963327;
}

.script-title,
#intro .names {
  margin: 4px 0 2px;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(40px, 11vw, 58px);
  line-height: 1.15;
  color: var(--ink);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
}

#intro .names .amp {
  color: var(--gold);
}

.intro-date {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.intro-date:empty {
  display: none;
}

/* nama tamu dari link personal (?to=...) */
#introGuest {
  display: none;
  margin: 2px auto 14px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed rgba(201, 162, 74, 0.75);
}

#introGuest .guest-label {
  font-size: 11px;
  color: var(--ink-soft);
}

#introGuest .guest-name {
  margin: 3px 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

#introGuest .guest-note {
  font-size: 9px;
  font-style: italic;
  color: var(--ink-soft);
  opacity: 0.8;
}

#nameInput,
#slugInput {
  display: block;
  width: 100%;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #8d6e5b;
  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(--rose);
  box-shadow: 0 0 0 3px rgba(165, 53, 42, 0.28);
}

/* Toba: the guest-choice cards get the same field edge (4,5:1, Sekar cek greybox §7.2). Set here, not in the shared
   "Karaktermu di pulau" block below, which stays byte-identical in all 2D themes; the id outranks its .look-opt rules,
   so the chosen and hover edges are repeated. */
#guestLook .look-opt { border-color: #8d6e5b; }
#guestLook .look-opt:has(input:checked) { border-color: var(--ink); }
@media (hover: hover) {
  #guestLook .look-opt:hover { border-color: var(--ink); }
}

.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(142, 43, 34, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.3s ease;
  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(142, 43, 34, 0.35);
}

.cta.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.intro-card .hint {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-soft);
}

#slugPrompt .hint {
  margin: 8px 0 14px;
}

#mpWarning {
  display: none;
  margin-top: 8px;
  font-size: 10px;
  color: #c0392b;
}

/* pelaminan mini di atas pulau pasir kecil di tengah laguna, mengayun pelan di atas kartu undangan */
.intro-hero {
  position: relative;
  flex-shrink: 0;
  width: min(64vw, 290px, 34vh);
  margin-bottom: 6px;
  z-index: 1;
  animation: heroFloat 5s ease-in-out infinite, riseIn 1s ease both;
}

@keyframes heroFloat {
  50% { transform: translateY(-5px); }
}

.intro-hero .hero-glow {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 150%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.85) 0%, rgba(255, 240, 220, 0.4) 35%, rgba(255, 255, 255, 0) 65%);
  animation: sunPulse 5s ease-in-out infinite;
}

/* pulau mini: gambar pelaminan (rasio ~7:6) di atas rumput, dikelilingi pasir, buih & air dangkal toska */
.hero-isle {
  position: relative;
  padding-bottom: 12%;
}

.hero-isle img {
  position: relative;
  z-index: 4;
  display: block;
  width: 100%;
  image-rendering: pixelated;
}

.hero-isle img[src=""] {
  visibility: hidden;
}

.hero-grass {
  position: absolute;
  z-index: 3;
  left: 4%;
  width: 92%;
  top: 38%;
  height: 32%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 38% 30%, #9cc276 0%, #78a457 52%, #5a8a45 100%);
  box-shadow: 0 3px 0 #4a7340;
}

.hero-sand {
  position: absolute;
  z-index: 2;
  left: -6%;
  width: 112%;
  top: 36%;
  height: 44%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 45% 35%, #e3dccd 0%, #cfc4ad 62%, #b3a68b 100%);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.85), 0 7px 0 3px rgba(31, 95, 139, 0.25);
}

.hero-water {
  position: absolute;
  z-index: 1;
  left: -24%;
  width: 148%;
  top: 26%;
  height: 66%;
  border-radius: 50%;
  background: radial-gradient(ellipse closest-side, rgba(222, 238, 244, 0.95) 0%, rgba(126, 178, 206, 0.85) 45%, rgba(63, 134, 173, 0.5) 75%, rgba(63, 134, 173, 0) 100%);
  animation: ripple 4.5s ease-in-out infinite;
}

@keyframes ripple {
  50% { transform: scale(1.05); opacity: 0.85; }
}

/* =====================================================================
   LAYAR LOADING
   ===================================================================== */
#loadingScreen {
  z-index: 55;
  justify-content: flex-start;
  padding-top: 24vh; /* di langit senja, di atas cakrawala */
}

/* perahu hias mengayun di atas ombak selama aset dimuat */
.loading-boat {
  position: relative;
  width: 92px;
  height: 64px;
  margin-bottom: 26px;
  animation: boatRock 2.4s ease-in-out infinite;
}

@keyframes boatRock {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-5px) rotate(3deg); }
}

/* lambung kayu dengan garis putih & koral */
.loading-boat .hull {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 20px;
  border-radius: 6px 6px 46px 46px / 6px 6px 30px 30px;
  background:
    linear-gradient(180deg, #9a7352 0 3px, transparent 3px),
    linear-gradient(180deg, #6e4b35, #4b3326);
}

.loading-boat .flag {
  position: absolute;
  left: 6px;
  bottom: 24px;
  width: 2px;
  height: 28px;
  background: #6b4426;
}

.loading-boat .flag::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 0;
  border-left: 12px solid #a0232b;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

/* ombak kecil di bawah perahu */
.loading-boat::after {
  content: '';
  position: absolute;
  left: -30px;
  right: -30px;
  bottom: 0;
  height: 6px;
  border-radius: 50%;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.9) 0 12px, transparent 12px 22px);
  animation: waveShift 1.6s linear infinite;
}

@keyframes waveShift {
  to { transform: translateX(22px); }
}

#loadingText {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
}

.loading-bar-track {
  width: min(70vw, 280px);
  height: 12px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 3px rgba(30, 20, 15, 0.2);
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose-2), var(--rose), var(--gold));
  transition: width 0.2s ease-out;
}

/* =====================================================================
   DUNIA GAME + HUD
   ===================================================================== */
#gameWrap {
  position: fixed;
  inset: 0;
  display: none;
  overflow: hidden;
}

#phaserContainer {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--sea-2);
}

#touchLayer {
  position: absolute;
  inset: 0;
  z-index: 5;
  touch-action: none;
}

#hud {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  z-index: 6;
  transform: translateX(-50%);
  max-width: calc(100% - 200px);
  padding: 6px 16px 7px;
  border-radius: 18px;
  background: var(--glass-dark);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 6px 18px rgba(20, 14, 11, 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(20, 14, 11, 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(36, 26, 21, 0.92);
  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(58, 41, 32, 0.94), rgba(36, 26, 21, 0.94));
  box-shadow: 0 8px 22px rgba(20, 14, 11, 0.35), 0 0 0 4px rgba(236, 211, 143, 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(20, 14, 11, 0.35), 0 0 0 7px rgba(236, 211, 143, 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(26, 19, 16, 0.35), rgba(26, 19, 16, 0.6));
  transition: opacity 0.4s ease;
  opacity: 1;
}

#tutorialOverlay.hide {
  opacity: 0;
  pointer-events: none;
}

#tutorialCard {
  width: min(92vw, 340px);
  padding: 20px 20px 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-align: left;
  animation: cardPop 0.45s cubic-bezier(.2, .8, .2, 1.2);
}

@keyframes cardPop {
  from { opacity: 0; transform: translateY(16px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

.tutorial-head {
  margin-bottom: 10px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  text-align: center;
  color: var(--ink);
}

#tutorialList div {
  padding: 7px 10px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  animation: riseIn 0.5s ease forwards; /* jeda tiap baris diisi script.js (muncul berurutan) */
}

.tutorial-skip {
  margin-top: 10px;
  font-size: 10px;
  text-align: center;
  color: var(--ink-soft);
  animation: blink 1.6s ease-in-out infinite;
}

@keyframes blink {
  50% { opacity: 0.35; }
}

/* ---------- Kontrol sosial: emote + chat (kiri bawah) ---------- */
#socialControls {
  position: absolute;
  z-index: 20;
  left: calc(16px + env(safe-area-inset-left));
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#emoteBar {
  display: flex;
  gap: 6px;
}

.emote-btn {
  width: 40px;
  height: 40px;
  font-size: 17px;
}

/* ---------- Tombol zoom (kanan bawah): + perbesar, − kembali ke seluruh pulau ---------- */
#zoomControls {
  position: absolute;
  z-index: 20;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#zoomControls button {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--glass-dark);
  border: 1.5px solid rgba(246, 217, 138, 0.85);
  color: var(--gold-2);
  box-shadow: 0 6px 16px rgba(20, 14, 11, 0.28);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

#zoomControls button:active:not(:disabled) {
  transform: scale(0.9);
  background: var(--rose);
}

#zoomControls button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* saat memilih filter photo booth, bilah filter memakai bagian bawah layar */
#photoFilterBar.show ~ #zoomControls {
  visibility: hidden;
}

/* menu cepat terbuka: tombol zoom disembunyikan supaya tidak menutupi item menu */
#quickMenu.open ~ #zoomControls {
  visibility: hidden;
}

#chatToggleBtn {
  width: 52px;
  height: 52px;
  font-size: 20px;
}

#chatComposer {
  position: absolute;
  z-index: 25;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: none;
  gap: 6px;
  width: min(86vw, 340px);
  padding: 6px;
  border-radius: 999px;
  background: var(--glass-dark);
  border: 1px solid rgba(246, 217, 138, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

#chatInput {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

#chatSendBtn {
  width: 40px;
  border: none;
  border-radius: 50%;
  background: var(--rose);
  color: 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(36, 26, 21, 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(20, 14, 11, 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(20, 14, 11, 0.58);
  -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, #3d2c23 0%, var(--panel-solid) 100%);
  box-shadow: 0 20px 50px rgba(15, 10, 8, 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: min-content; /* selebar kata terpanjang: "MEMPELAI" / "PRIA" atau "WANITA" selalu dua baris, kedua label sama tinggi */
  max-width: 90%;
  margin: -14px auto 8px;
  background: #fdf6ea;
  border: 1px solid #c9a45c;
  border-radius: 999px;
  color: var(--maroon);
  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;
  overflow-wrap: anywhere; /* hanya kata yang lebih lebar dari kartu dipatah; ukuran huruf tetap */
}

.profile-parents {
  background: #f3e6c8;
  border-radius: 10px;
  padding: 8px;
  text-align: left;
  font-size: 10px;
  line-height: 1.6;
}

.profile-parents-label {
  color: var(--maroon);
  font-weight: 700;
  font-size: 9px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.profile-parents .pp-label {
  color: var(--maroon);
  font-weight: 700;
  margin-right: 3px;
}

.profile-ig {
  margin-top: 8px;
  font-size: 10px;
  opacity: 0.85;
}

/* Kedua kartu berbagi baris (subgrid): foto, label, nama, "Putra/Putri dari" dan Instagram
   mulai di tinggi yang sama walau nama atau nama orang tua di satu kartu lebih panjang.
   Teks tidak dikecilkan atau dipotong. Browser tanpa subgrid tetap memakai tata letak flex di atas. */
@supports (grid-template-rows: subgrid) {
  .profile-cards {
    container-type: inline-size;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0 10px;
  }

  .profile-card {
    display: grid;
    grid-row: span 5;
    grid-template-rows: subgrid;
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-photo-frame { grid-row: 1; }
  .profile-badge { grid-row: 2; align-self: start; }
  .profile-name { grid-row: 3; align-self: center; }
  .profile-parents { grid-row: 4; }
  .profile-ig { grid-row: 5; }

  /* layar sangat sempit: kartu bertumpuk (kurang dari 2 x 130px), jaraknya 10px seperti sebelumnya */
  @container (width < 270px) {
    .profile-card + .profile-card { margin-top: 10px; }
  }
}

/* ---------- 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: #1a1310;
  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(201, 162, 74, 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(--soft-ink);
  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, #1a1310, #2e221c);
  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, #1a1310, #2e221c);
}

#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(26, 19, 16, 0.62) 0%, rgba(26, 19, 16, 0.38) 45%, rgba(26, 19, 16, 0) 72%);
  text-align: center;
  text-shadow: 0 2px 18px rgba(15, 10, 8, 0.6);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -44%);
  transition: opacity 0.9s ease, transform 1.2s ease;
}

#titleCard.show {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.tc-kicker {
  font-size: 11px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: #ffe9b0;
}

.tc-names {
  margin: 6px 0;
  font-family: var(--script);
  font-size: clamp(46px, 12vw, 82px);
  line-height: 1.15;
  color: #fff;
}

.tc-names span {
  color: var(--gold-2);
}

.tc-line {
  width: 140px;
  height: 2px;
  margin: 4px auto 10px;
  background: linear-gradient(90deg, transparent, var(--gold-2), transparent);
}

.tc-date {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #fff4e0;
}

#skipCinemaBtn {
  display: none;
  position: absolute;
  z-index: 23;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(3vh + env(safe-area-inset-bottom));
  padding: 8px 16px;
  border: 1px solid rgba(246, 217, 138, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold-2);
  font-size: 12px;
  cursor: pointer;
}

#gameWrap.cinema #skipCinemaBtn {
  display: block;
}

/* selama sinematik & mini game, kontrol HUD disembunyikan (mini game punya HUD sendiri di Phaser) */
#gameWrap.cinema #hud,
#gameWrap.cinema #ambienceBtn,
#gameWrap.cinema #menuToggleBtn,
#gameWrap.cinema #quickMenu,
#gameWrap.cinema #questPill,
#gameWrap.cinema #socialControls,
#gameWrap.cinema #zoomControls,
#gameWrap.cinema #chatComposer,
#gameWrap.cinema #prompt,
#gameWrap.minigame #hud,
#gameWrap.minigame #ambienceBtn,
#gameWrap.minigame #menuToggleBtn,
#gameWrap.minigame #quickMenu,
#gameWrap.minigame #questPill,
#gameWrap.minigame #socialControls,
#gameWrap.minigame #zoomControls,
#gameWrap.minigame #chatComposer,
#gameWrap.minigame #prompt,
#gameWrap.minigame #wishCard {
  visibility: hidden;
}

/* mini game menerima sentuhan langsung di kanvas Phaser */
#gameWrap.minigame #touchLayer,
#gameWrap.minigame #joystickBase {
  display: none;
}

/* ---------- Pil progres "Jejak Kisah Cinta" (kiri atas) ---------- */
#questPill {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(10px + env(safe-area-inset-top));
  left: calc(14px + env(safe-area-inset-left));
  height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--rose-2);
  border-radius: 999px;
  background: var(--glass-dark);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 16px rgba(20, 14, 11, 0.28);
  color: #f5dcd3;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#questPill.done {
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  border-color: #fff;
  color: var(--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(36, 26, 21, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 22px rgba(15, 10, 8, 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(36, 26, 21, 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: var(--maroon);
}

.story-card.locked .story-meta {
  color: var(--gold-2);
}

.story-year {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--maroon);
  color: #fff;
}

.story-title {
  margin: 4px 0 6px;
  font-family: var(--script);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--maroon);
}

.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 var(--maroon);
}

#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: var(--maroon);
  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; }
}

/* ---------- "Karaktermu di pulau" on the 2D intro card (Sekar, docs/design/20261128-tamu-wanita-2d.md §2) ----------
   Byte-identical in all five 2D themes: every colour comes from the theme's own tokens (--ink, --ink-soft, --gold-2,
   --line). Same structure as Janur's .look-pick (docs/design/20261114-janur-pilih-karakter.md), with pixel portraits. */
.look-pick {
  min-width: 0;
  margin: -4px 0 14px;
  padding: 0;
  border: 0;
}

.look-pick legend {
  margin: 0 auto 6px;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  color: color-mix(in srgb, var(--ink) 50%, var(--ink-soft)); /* = .hint and the P8 credit, >= 5.1:1 in all five */
}

/* minmax(0, 1fr): two equal columns that never grow past the name field, whatever the font does */
.look-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* one choice = one 56 px card; the native radio dot stays visible, so the choice never rests on colour alone */
.look-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 56px;
  padding: 4px 6px 4px 8px;
  border: 1.5px solid rgba(176, 138, 58, 0.45); /* = #nameInput edge */
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.look-opt input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--ink);
}

.look-opt input:focus {
  outline: none; /* the focus ring goes round the whole card (:has below) */
}

/* the 24 x 24 px pixel crop: 48 px (exactly 2x) from 390 px, 36 px (1.5x) on narrower phones, the same size in both
   cards. If a font or an old phone still makes a card too narrow, the portrait shrinks first, never the word or the
   radio dot. Crisp like #introHero. */
.look-opt img {
  flex: 0 1 48px;
  min-width: 20px;
  width: 48px;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 0 0 1px var(--line);
  image-rendering: pixelated;
}

.look-opt span {
  flex: none;
}

/* chosen: --ink edge 1.5 px + 1 px inset (no layout shift) and a --gold-2 tint */
.look-opt:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  background: rgba(246, 217, 138, 0.6);                        /* browsers without color-mix() */
  background: color-mix(in srgb, var(--gold-2) 60%, #fff 40%);
}

.look-opt:has(input:focus-visible) {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

@media (hover: hover) {
  .look-opt:hover {
    border-color: var(--ink);
  }
}

/* short screens: the same rhythm as #nameInput in the existing max-height: 940px block */
@media (max-height: 940px) {
  .look-pick { margin-bottom: 10px; }
  .look-pick legend { margin-bottom: 4px; }
}

/* very short screens (360 x 640 with the ?to= guest box): smaller hero, 52 px cards (>= 44 px), 44 px portraits */
@media (max-height: 700px) {
  #intro .intro-hero { width: min(64vw, 290px, 27vh); }
  .look-opt { min-height: 52px; padding-top: 2px; padding-bottom: 2px; }
  .look-opt img { flex-basis: 44px; width: 44px; }
}

/* phones narrower than 390 px (360, 375): both portraits 36 px, so "Wanita" fits its card (after the rule above) */
@media (max-width: 389px) {
  .look-opt { gap: 5px; }
  .look-opt img { flex-basis: 36px; width: 36px; }
}

/* phones in landscape: the card alone, scrolled from the top. Centred, the card is taller than the screen and its top
   (the kicker and the couple's names; Sakinah's crest and bismillah) cannot be scrolled to. The hero is decoration
   (aria-hidden) and is already off-screen at this height. */
@media (max-height: 500px) {
  #intro { justify-content: flex-start; padding-top: max(28px, env(safe-area-inset-top)); } /* room for the Sakura/Sakinah crest */
  #intro > .intro-card { margin-block: auto; }
  #intro .intro-hero { display: none; }
}

/* the picker adds one child to the card: the hint must not rise before the buttons in any theme
   (Laguna/Telaga/Kahyangan count delays from child 1, Sakura/Sakinah from child 2). The credit keeps its 1.5 s. */
#intro .intro-card > .hint {
  animation-delay: 1.4s;
}
