:root {
  --primary: #214230;
  --primary-dark: #142a1e;
  --maroon: #78171f;
  --maroon-dark: #4f0d13;
  --wood-dark: #361e10;
  --wood-mid: #59331b;
  --gold: #d4a937;
  --gold-bright: #f7df94;
  --parchment: #fbf5e6;
  --parchment-dark: #efe3c8;
  --ink: #2b1b10;
  --ink-muted: #6e5846;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #17100c;
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--ink);
}

/* ==================== 1. COVER PEMBUKA ==================== */
#cover-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 42px 20px 24px;
  text-align: center;
  color: #fff;
  transition: opacity 0.75s ease, visibility 0.75s ease;
}
#cover-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#cover-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.cover-top, .cover-bottom {
  position: relative;
  z-index: 2;
  max-width: 450px;
  width: 100%;
}
.cover-sub {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.85);
}
.cover-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(44px, 9vw, 66px);
  font-weight: 700;
  line-height: 1.05;
  text-shadow: 0 4px 24px rgba(0,0,0,0.9);
}
.cover-title span {
  color: var(--gold);
  font-style: italic;
}
.cover-tagline {
  margin-top: 8px;
  font-size: 13.5px;
  color: #f2e8d9;
  text-shadow: 0 2px 10px rgba(0,0,0,0.85);
}

.rpg-invite-scroll {
  background: rgba(28, 17, 12, 0.88);
  border: 3px solid var(--gold);
  outline: 3px solid var(--wood-dark);
  border-radius: 16px;
  padding: 22px;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.75), inset 0 0 0 3px rgba(212, 169, 55, 0.25);
}
.invite-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 4px;
}
.invite-guest {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}

.serumah-cover-brand {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  background: rgba(18, 10, 6, 0.55);
  border: 1px solid rgba(212, 169, 55, 0.35);
  color: rgba(255, 240, 200, 0.78);
  font-size: 11px;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}
.serumah-cover-brand:hover {
  background: rgba(28, 16, 10, 0.85);
  color: var(--gold-bright);
  border-color: var(--gold);
  transform: translateY(-1px);
}
.serumah-cover-brand img {
  height: 16px;
  width: auto;
  object-fit: contain;
}

.serumah-modal-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(180, 145, 90, 0.45);
  text-align: center;
}
.serumah-modal-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 600;
  opacity: 0.82;
  transition: opacity 0.2s ease, color 0.2s ease;
}
.serumah-modal-link:hover {
  opacity: 1;
  color: var(--maroon);
}
.serumah-modal-link img {
  height: 15px;
  width: auto;
  object-fit: contain;
}

/* ==================== 2. TOMBOL RPG 3D BERSIH ==================== */
.rpg-btn-3d {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: 2px solid var(--wood-dark);
  background: linear-gradient(180deg, #fffdf9 0%, #e7d8be 100%);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--wood-dark), 0 6px 12px rgba(0,0,0,0.22), inset 0 2px 0 rgba(255,255,255,0.7);
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s ease, filter 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.rpg-btn-3d.full { width: 100%; }
.rpg-btn-3d.primary {
  background: linear-gradient(180deg, #2e5c43 0%, #1c3b2a 100%);
  border-color: var(--gold);
  outline: 2px solid #112419;
  color: #fff;
  box-shadow: 0 4px 0 #0f2117, 0 6px 14px rgba(0,0,0,0.3), inset 0 2px 0 rgba(255,255,255,0.25);
}
.rpg-btn-3d.gold {
  width: 100%;
  background: linear-gradient(180deg, #f5d97e 0%, #c4922c 100%);
  border-color: #4a3008;
  color: #2b1803;
  box-shadow: 0 4px 0 #4a3008, 0 8px 20px rgba(0,0,0,0.4), inset 0 2px 0 rgba(255,255,255,0.65);
}
.rpg-btn-3d:hover {
  filter: brightness(1.07);
  transform: translateY(-2px);
}
.rpg-btn-3d:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--wood-dark);
}

/* ==================== 3. POPUP WINDOW & POSISI TEKS RIBBON CENTER ==================== */
.overlay-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(14, 9, 6, 0.74);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 46px 12px 16px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.overlay-modal.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.rpg-window {
  position: relative;
  max-width: 450px;
  width: 100%;
  background: linear-gradient(180deg, #4f2c17 0%, #30190c 100%);
  border: 3.5px solid var(--gold);
  outline: 3px solid #1a0d05;
  border-radius: 20px;
  padding: 24px 10px 10px;
  box-shadow: 0 28px 65px rgba(0,0,0,0.8), inset 0 2px 0 rgba(255, 230, 150, 0.45);
  transform: scale(1) translateY(0);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
.overlay-modal.hidden .rpg-window {
  transform: scale(0.88) translateY(26px);
}

/* PERBAIKAN POIN 3: Teks di dalam Ribbon dinaikkan agar pas di tengah plang marun */
.rpg-ribbon-header {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  width: 310px;
  max-width: 88vw;
  height: 56px;
  padding: 0 70px 7px; /* Padding bawah 7px mengangkat teks ke tengah kotak marun */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent !important;
  background-image: url('../img/ui_ribbon_header.webp');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.55));
  white-space: nowrap;
  pointer-events: none;
}
.rpg-ribbon-header span {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold-bright);
  text-shadow: 0 2px 4px rgba(0,0,0,0.95);
  line-height: 1;
  transform: translateY(-3px); /* Mengangkat posisi vertikal teks agar presisi di tengah */
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rpg-close-btn {
  position: absolute;
  top: -18px;
  right: -10px;
  z-index: 10;
  width: 42px;
  height: 42px;
  border: none;
  background-color: transparent !important;
  background-image: url('../img/ui_btn_close.webp');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  color: transparent;
  cursor: pointer;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.55));
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rpg-close-btn.small {
  top: -15px;
  right: -10px;
  width: 38px;
  height: 38px;
}
.rpg-close-btn:hover { transform: scale(1.1); }
.rpg-close-btn:active { transform: scale(0.92); }

.rpg-window-inner {
  background: radial-gradient(circle at 50% 15%, #fffdf9 0%, var(--parchment) 70%, var(--parchment-dark) 100%);
  border: 2px solid #c9b082;
  border-radius: 13px;
  padding: 16px 14px 16px;
  max-height: 76vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: inset 0 0 20px rgba(120, 85, 38, 0.16);
}

.ui-ornament-divider {
  width: 100%;
  height: 20px;
  background-image: url('../img/ui_header_ornament.webp');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin: 0 auto 6px;
}

.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(23px, 6vw, 28px);
  font-weight: 700;
  text-align: center;
  color: var(--maroon);
  margin-bottom: 2px;
}
.card-desc {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

/* Pilihan Avatar */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  width: 100%;
}
.avatar-card {
  min-width: 0;
  background: #f5ebd6;
  border: 2.5px solid #cbb386;
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 0 #b89f72;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.avatar-card.selected {
  border-color: var(--maroon);
  background: #fff8e8;
  box-shadow: 0 4px 0 var(--maroon), 0 8px 18px rgba(120, 23, 31, 0.18);
  transform: translateY(-2px);
}
.avatar-frame-box {
  background-image: url('../img/ui_portrait_frame.webp');
  background-size: 100% 100%;
  border-radius: 10px;
  margin: 0 auto 6px;
  padding: 8px;
  width: 100%;
  max-width: 128px;
  aspect-ratio: 140 / 158;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}
.avatar-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 700;
}
.avatar-sub { font-size: 11px; color: var(--ink-muted); }

.form-group { margin-bottom: 12px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--wood-mid);
  margin-bottom: 5px;
}
.rpg-input, .rpg-select, .rpg-textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 2px solid #c5ae84;
  background: #fffdf9;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.rpg-input:focus, .rpg-textarea:focus { border-color: var(--maroon); }

/* ==================== 4. MAIN GAME HUD, JOYSTICK BESAR, & TOMBOL NGOBROL ==================== */
#game-wrap {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #efe6d5;
}
#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

.hud-brand {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 30;
  background: var(--parchment);
  border: 2.5px solid var(--gold);
  outline: 2px solid var(--wood-dark);
  border-radius: 12px;
  padding: 8px 14px;
  box-shadow: 0 4px 0 var(--wood-dark), 0 8px 18px rgba(0,0,0,0.25);
  pointer-events: none;
}
.hud-brand-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  line-height: 1.05;
}
.hud-brand-sub {
  font-size: 9.5px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--maroon);
  font-weight: 800;
  margin-top: 2px;
}

.hud-top-right {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 30;
  display: flex;
  gap: 6px;
  background: var(--parchment);
  border: 2.5px solid var(--gold);
  outline: 2px solid var(--wood-dark);
  border-radius: 30px;
  padding: 4px 8px;
  box-shadow: 0 4px 0 var(--wood-dark), 0 8px 18px rgba(0,0,0,0.25);
}
.hud-pill-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hud-pill-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--wood-dark);
  stroke-width: 2.2;
  fill: none;
}
.hud-pill-btn:hover { background: #e8dac0; }

#joystick-pad {
  position: fixed;
  bottom: 94px;
  left: 22px;
  width: 78px;
  height: 78px;
  z-index: 32;
  border-radius: 22px;
  background: radial-gradient(circle at 50% 45%, rgba(44, 84, 62, 0.94) 0%, rgba(24, 48, 35, 0.96) 100%);
  border: 3px solid var(--gold);
  outline: 2.5px solid var(--wood-dark);
  box-shadow: 0 6px 0 var(--wood-dark), 0 12px 24px rgba(0,0,0,0.4), inset 0 2px 6px rgba(255,255,255,0.2);
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#joystick-pad::before {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  border: 1px dashed rgba(247, 223, 148, 0.35);
  pointer-events: none;
}
#joystick-stick {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffdf9 0%, #e5cfa3 100%);
  border: 2.5px solid var(--gold);
  outline: 1.5px solid var(--wood-dark);
  box-shadow: 0 4px 8px rgba(0,0,0,0.45);
  pointer-events: none;
  transition: transform 0.04s linear;
}

#interact-btn {
  position: fixed;
  bottom: 98px;
  right: 20px;
  z-index: 34;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 50px;
  background: linear-gradient(180deg, #8f1d27 0%, #5c0f16 100%);
  border: 2.5px solid var(--gold);
  outline: 2.5px solid var(--wood-dark);
  color: #fffdf7;
  font-family: inherit;
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--wood-dark), 0 12px 26px rgba(0,0,0,0.48), inset 0 2px 0 rgba(255,255,255,0.28);
  animation: interactPulse 1.6s infinite ease-in-out;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#interact-btn.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px) scale(0.9);
  animation: none;
}
@keyframes interactPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.04); }
}
#interact-btn:active {
  transform: translateY(2px) scale(0.96);
  box-shadow: 0 2px 0 var(--wood-dark);
}
.interact-icon { font-size: 17px; line-height: 1; }
.interact-label {
  white-space: nowrap;
  max-width: 155px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--gold-bright);
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.hud-dock {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  background: linear-gradient(180deg, #fffdf8 0%, var(--parchment-dark) 100%);
  border: 2.5px solid var(--gold);
  outline: 2.5px solid var(--wood-dark);
  border-radius: 18px;
  padding: 6px 10px;
  display: flex;
  gap: 8px;
  box-shadow: 0 5px 0 var(--wood-dark), 0 12px 30px rgba(0,0,0,0.35);
  max-width: calc(100vw - 16px);
}
.dock-item {
  border-radius: 12px;
  border: 1.5px solid transparent;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 5px 10px;
  min-width: 60px;
  color: var(--ink);
  transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dock-item img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.18));
  transition: transform 0.18s ease;
}
.dock-item span {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--wood-dark);
  white-space: nowrap;
}
.dock-item:hover {
  background: #fdf6e4;
  border-color: var(--gold);
  transform: translateY(-4px);
}
.dock-item:hover img {
  transform: scale(1.16) rotate(-4deg);
}

/* ==================== 5. BUBBLE CHAT SESUAI REFERENSI ==================== */
#rpg-dialog {
  position: fixed;
  bottom: 82px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  width: calc(100vw - 24px);
  max-width: 720px;
  display: none;
  pointer-events: none;
}
#rpg-dialog.active {
  display: block;
  animation: popUpDialog 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes popUpDialog {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.rpg-bust-container {
  position: absolute;
  left: 10px;
  bottom: calc(100% - 28px);
  width: 260px;
  height: 280px;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.5));
  animation: portraitBreath 3s infinite ease-in-out;
  transform-origin: bottom center;
}
@keyframes portraitBreath {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-5px) scale(1.015); }
}
#rpg-portrait {
  width: 100%;
  height: 100%;
  display: block;
}

.rpg-chat-box {
  position: relative;
  z-index: 3;
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.98) 0%, rgba(244, 233, 209, 0.99) 100%);
  border: 3.5px solid var(--gold);
  outline: 3px solid var(--wood-dark);
  border-radius: 18px;
  padding: 28px 24px 18px;
  box-shadow: 0 8px 0 var(--wood-dark), 0 22px 50px rgba(0,0,0,0.55), inset 0 0 0 3px rgba(212, 169, 55, 0.2);
}

.rpg-name-plate {
  position: absolute;
  top: -22px;
  left: 255px;
  z-index: 5;
  background: linear-gradient(135deg, #f3cc54 0%, #c89628 100%);
  border: 2.5px solid var(--wood-dark);
  border-radius: 8px;
  padding: 6px 24px;
  transform: skewX(-12deg);
  box-shadow: 3px 4px 0 var(--wood-dark);
}
.rpg-name-plate span {
  display: block;
  transform: skewX(12deg);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--wood-dark);
}

.rpg-text {
  font-size: 14.5px;
  line-height: 1.58;
  color: var(--ink);
  min-height: 46px;
  font-weight: 600;
  padding-left: 4px;
}
.rpg-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* ==================== 6. KARTU AKAD & RESEPSI TERPISAH, GALERI NAV, & KADO ==================== */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.cd-box {
  background: linear-gradient(180deg, var(--wood-mid) 0%, var(--wood-dark) 100%);
  color: #fff;
  border: 2px solid var(--gold);
  border-radius: 11px;
  padding: 9px 6px;
  text-align: center;
  box-shadow: 0 3px 0 #1f1108;
}
.cd-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 23px;
  font-weight: 700;
  color: var(--gold-bright);
  line-height: 1;
}
.cd-lbl { font-size: 9.5px; opacity: 0.9; margin-top: 3px; text-transform: uppercase; }

/* Kartu Sesi Acara (Akad Nikah vs Resepsi) */
.session-card {
  background: linear-gradient(135deg, #fffdf9 0%, #f4e8cf 100%);
  border: 2px solid #d4be94;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 4px 0 #cbb386;
  position: relative;
}
.session-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--maroon);
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
  border: 1px solid var(--gold);
}
.session-badge.emerald {
  background: var(--primary);
}
.session-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 13px;
}
.session-row:last-child { margin-bottom: 0; }
.session-row-icon {
  font-size: 15px;
  line-height: 1.3;
  flex-shrink: 0;
}
.session-row-text b {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
}
.session-row-text span {
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* Galeri & Navigasi Bawah Anti-Tabrakan (POIN 3) */
.gallery-box {
  border-radius: 14px;
  overflow: hidden;
  border: 3px solid var(--gold);
  outline: 2px solid var(--wood-dark);
  aspect-ratio: 4/4.3;
  background: #e9decb;
  margin-bottom: 10px;
  position: relative;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}
.gallery-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gal-anim-next { animation: slideNextAnim 0.42s cubic-bezier(0.22, 1, 0.36, 1); }
.gal-anim-prev { animation: slidePrevAnim 0.42s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes slideNextAnim {
  0% { opacity: 0; transform: translateX(38px) scale(0.96); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes slidePrevAnim {
  0% { opacity: 0; transform: translateX(-38px) scale(0.96); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
.gallery-caption-text {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--maroon);
  margin-bottom: 6px;
  animation: fadeCaption 0.38s ease;
}
@keyframes fadeCaption {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}
.gal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbb386;
  transition: all 0.25s ease;
  cursor: pointer;
}
.gal-dot.active {
  width: 22px;
  border-radius: 10px;
  background: var(--maroon);
}

/* Bar Navigasi Galeri 3 Kolom Proporsional (Tombol 1 Baris & Nomor Halaman Rapi) */
.gallery-nav-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.gallery-nav-btn {
  padding: 9px 10px !important;
  font-size: 12px !important;
  white-space: nowrap !important;
  width: 100%;
}
.gallery-page-pill {
  background: #efe2c6;
  border: 1.5px solid #c5ae84;
  color: var(--wood-dark);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  text-align: center;
}

.timeline-wrap {
  position: relative;
  padding-left: 26px;
  margin-top: 10px;
}
.timeline-wrap::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2.5px;
  background: linear-gradient(180deg, var(--maroon), var(--gold), var(--primary));
}
.tl-card {
  position: relative;
  background: linear-gradient(135deg, #fffdf9 0%, #f4e8cf 100%);
  border: 2px solid #d4be94;
  border-radius: 13px;
  padding: 13px 15px;
  margin-bottom: 13px;
  box-shadow: 0 4px 0 #cbb386, 0 6px 14px rgba(0,0,0,0.06);
  opacity: 0;
  animation: storyReveal 0.48s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--i, 0) * 0.13s);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.tl-card:hover {
  transform: translateX(4px);
  border-color: var(--gold);
}
@keyframes storyReveal {
  0% { opacity: 0; transform: translateY(18px) translateX(-10px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) translateX(0) scale(1); }
}
.tl-card::before {
  content: '✦';
  position: absolute;
  left: -26px;
  top: 14px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--maroon);
  border: 2px solid var(--gold);
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(212, 169, 55, 0.25);
}
.tl-year-badge {
  display: inline-block;
  background: var(--maroon);
  color: var(--gold-bright);
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 20px;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.royal-bank-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 18px 18px 16px;
  margin-bottom: 14px;
  color: #fffdf7;
  background: linear-gradient(135deg, #5e1118 0%, #38080c 55%, #24130b 100%);
  border: 2px solid var(--gold);
  outline: 2px solid var(--wood-dark);
  box-shadow: 0 6px 0 var(--wood-dark), 0 14px 28px rgba(0,0,0,0.28);
  opacity: 0;
  animation: storyReveal 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--i, 0) * 0.12s);
}
.royal-bank-card.emerald {
  background: linear-gradient(135deg, #1f4531 0%, #11291c 60%, #1c140d 100%);
}
.royal-bank-card::after {
  content: '❖';
  position: absolute;
  right: -12px;
  bottom: -22px;
  font-size: 96px;
  color: rgba(247, 223, 148, 0.08);
  pointer-events: none;
}
.bank-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.bank-chip {
  width: 38px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f7df94 0%, #c2912c 100%);
  border: 1px solid rgba(255,255,255,0.6);
  position: relative;
  box-shadow: inset 0 0 0 2px rgba(90, 55, 10, 0.35);
}
.bank-chip::before {
  content: '';
  position: absolute;
  inset: 6px 4px;
  border: 1px solid rgba(90, 55, 10, 0.45);
  border-radius: 2px;
}
.bank-badge-name {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-bright);
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(212, 169, 55, 0.45);
  padding: 4px 11px;
  border-radius: 20px;
}
.bank-acc-num {
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  margin-bottom: 4px;
}
.bank-acc-holder {
  font-size: 12.5px;
  color: rgba(255, 240, 210, 0.85);
  margin-bottom: 14px;
}
.bank-copy-btn {
  width: 100%;
  padding: 9px 14px;
  border-radius: 9px;
  border: 1.5px solid var(--gold);
  background: rgba(255, 255, 255, 0.12);
  color: var(--gold-bright);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.18s ease;
}
.bank-copy-btn:hover {
  background: var(--gold);
  color: #241305;
}
.bank-copy-btn.copied {
  background: #287a48;
  border-color: #8ce6ad;
  color: #fff;
}

.gift-address-box {
  background: #f5ebd6;
  border: 2px dashed #b89b67;
  border-radius: 13px;
  padding: 13px 15px;
  text-align: center;
  margin-top: 6px;
}

.wish-card {
  background: #f5ebd6;
  border: 1.5px solid #d4be94;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.wax-seal-footer {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

@media (max-width: 600px) {
  .dock-item { min-width: 52px; padding: 5px 7px; }
  .dock-item img { width: 24px; height: 24px; }
  .dock-item span { font-size: 9.5px; }

  #joystick-pad {
    bottom: 92px;
    left: 20px;
    width: 74px;
    height: 74px;
  }
  #joystick-stick {
    width: 32px;
    height: 32px;
  }

  #interact-btn {
    bottom: 96px;
    right: 16px;
    padding: 11px 16px;
    font-size: 13px;
  }

  .rpg-window {
    padding: 22px 8px 8px;
  }
  .rpg-ribbon-header {
    width: 295px;
    height: 52px;
    padding: 0 66px 6px;
    top: -31px;
  }
  .rpg-ribbon-header span {
    font-size: 12px;
    letter-spacing: 1px;
    transform: translateY(-2.5px);
  }

  .avatar-frame-box {
    max-width: 110px;
    padding: 6px;
  }

  .rpg-bust-container {
    width: 195px;
    height: 210px;
    left: 4px;
    bottom: calc(100% - 22px);
  }
  .rpg-name-plate {
    left: 182px;
    top: -19px;
    padding: 5px 16px;
  }
  .rpg-name-plate span {
    font-size: 13px;
  }
}