*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --page-w: 432px;
  --page-h: 768px;
  --surface: #f3eee6;
  --control: #ffffff;
  --ink: #2b2722;
  --muted: #777;
  --track: #c9c9c9;
  --track-active: #696969;
}

html,
body {
  min-height: 100%;
}

body {
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .46) 0 26%, transparent 26% 100%),
    linear-gradient(24deg, rgba(255, 255, 255, .42) 0 31%, transparent 31% 100%),
    linear-gradient(135deg, #f2f2f2 0%, #d7d7d7 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.scene {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 36px 110px 50px;
  overflow: hidden;
}

.top-tools {
  position: fixed;
  top: 38px;
  right: 78px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 8px 16px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
  backdrop-filter: blur(6px);
}

.tool-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #080808;
  cursor: pointer;
}

.tool-btn svg,
.side-btn svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-btn:hover,
.tool-btn.is-active {
  background: rgba(0, 0, 0, .06);
}

.tool-btn.is-muted .icon-sound-on,
.tool-btn:not(.is-muted) .icon-sound-off {
  display: none;
}

.book-wrapper {
  position: relative;
  transform-origin: top center;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .18));
}

.page {
  position: relative;
  width: var(--page-w);
  height: var(--page-h);
  overflow: hidden;
  background: var(--surface);
  user-select: none;
  -webkit-user-select: none;
}

.page-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.hotspot {
  position: absolute;
  z-index: 30;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.hotspot-rsvp {
  left: 29.5%;
  top: 30.1%;
  width: 41.5%;
  height: 5.9%;
}

.hotspot-maps {
  left: 26.5%;
  top: 68.5%;
  width: 47.5%;
  height: 6.9%;
}

.hotspot-copy-bca {
  left: 28.7%;
  top: 42.9%;
  width: 43.2%;
  height: 6.2%;
}

.hotspot-copy-mandiri {
  left: 28.7%;
  top: 76.2%;
  width: 43.2%;
  height: 6.2%;
}

.debug-hotspots .hotspot {
  background: rgba(255, 0, 64, .22);
  outline: 2px solid rgba(255, 0, 64, .72);
  outline-offset: -2px;
}

.side-btn {
  position: fixed;
  bottom: 90px;
  z-index: 12;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #111;
  cursor: pointer;
}

.side-btn svg {
  stroke-width: 1.75;
  filter: drop-shadow(0 2px 1px rgba(255, 255, 255, .85));
}

.side-btn-prev {
  left: max(28px, calc(50% - 566px));
}

.side-btn-next {
  right: max(28px, calc(50% - 566px));
}

.side-btn:active {
  transform: translateY(1px);
}

.bottom-bar {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 15;
  width: min(74vw, 1180px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
}

.page-counter {
  min-width: 78px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, .78);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
}

.page-scrubber {
  width: 100%;
  height: 18px;
  accent-color: var(--track-active);
  cursor: pointer;
}

.page-scrubber::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--track-active) 0 var(--scrubber, 0%),
    var(--track) var(--scrubber, 0%) 100%
  );
}

.page-scrubber::-webkit-slider-thumb {
  width: 136px;
  height: 10px;
  margin-top: 0;
  border: 0;
  border-radius: 999px;
  background: var(--track-active);
  -webkit-appearance: none;
}

.page-scrubber::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: var(--track);
}

.page-scrubber::-moz-range-progress {
  height: 10px;
  border-radius: 999px;
  background: var(--track-active);
}

.page-scrubber::-moz-range-thumb {
  width: 136px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: var(--track-active);
}

.thumb-panel {
  position: fixed;
  top: 108px;
  right: 78px;
  z-index: 25;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 148px);
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity .18s ease, transform .18s ease;
}

.thumb-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.thumb-item {
  border: 2px solid transparent;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .08);
}

.thumb-item.is-active {
  border-color: var(--track-active);
}

.thumb-item img {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
}

.rsvp-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.rsvp-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.rsvp-card {
  position: relative;
  width: min(420px, 100%);
  max-height: min(680px, calc(100vh - 36px));
  overflow: auto;
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

.rsvp-card h2 {
  margin-bottom: 18px;
  font-size: 26px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

.rsvp-form {
  display: grid;
  gap: 14px;
}

.rsvp-form label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

.rsvp-form input,
.rsvp-form textarea,
.rsvp-form select {
  width: 100%;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
}

.rsvp-form textarea {
  min-height: 110px;
  resize: vertical;
}

.submit-btn {
  height: 42px;
  border: 0;
  border-radius: 6px;
  background: #111;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.wish-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.wish-item {
  padding: 12px;
  border-radius: 6px;
  background: #f3f3f3;
}

.wish-item strong {
  display: block;
  margin-bottom: 4px;
}

.wish-attendance {
  display: block;
  margin-bottom: 4px;
  color: #555;
}

.wish-guests {
  display: block;
  margin-bottom: 6px;
  color: #555;
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 78px;
  z-index: 45;
  transform: translateX(-50%) translateY(10px);
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(17, 17, 17, .92);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.copy-toast.is-open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  .scene {
    gap: 12px;
    padding: 72px 12px 68px;
  }

  .top-tools {
    top: 12px;
    right: 12px;
    left: 12px;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 6px 10px;
  }

  .tool-btn {
    width: 36px;
    height: 36px;
  }

  .side-btn {
    bottom: 72px;
    width: 46px;
    height: 46px;
  }

  .side-btn-prev {
    left: 8px;
  }

  .side-btn-next {
    right: 8px;
  }

  .bottom-bar {
    bottom: 18px;
    width: calc(100vw - 24px);
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .page-counter {
    display: none;
  }

  .page-scrubber::-webkit-slider-thumb {
    width: 76px;
  }

  .page-scrubber::-moz-range-thumb {
    width: 76px;
  }

  .thumb-panel {
    top: 74px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .thumb-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .copy-toast {
    bottom: 62px;
  }
}
