:root {
  --bg: #0b0710;
  --bg-soft: #1a1020;
  --card: #1d1426;
  --card-line: #35243f;
  --ink: #f4e9f0;
  --ink-soft: #c9b6c7;
  --whisper: #9a7f96;
  --rose: #e5567a;
  --rose-deep: #b8375c;
  --gold: #e8c07d;
  --locked: #4a3b52;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Josefin Slab', Georgia, serif;
  font-size: 18px;
  line-height: 1.65;
  overflow-x: hidden;
}

.screen { min-height: 100vh; min-height: 100dvh; }
.hidden { display: none !important; }

/* ---------- Typography ---------- */
.script-lead {
  font-family: 'Dancing Script', cursive;
  color: var(--rose);
  font-size: 2.1rem;
  margin: 0.2rem 0 0;
}
.script-lead.big { font-size: 2.5rem; color: var(--ink); line-height: 1.2; }

.mega {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(4rem, 22vw, 9rem);
  line-height: 0.95;
  margin: 0.4rem 0 0;
  color: var(--ink);
  text-shadow: 0 6px 30px rgba(229, 86, 122, 0.35);
}
.mega.small { font-size: clamp(2.2rem, 9vw, 3.4rem); }

.eyebrow {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--gold);
  margin: 0;
}
.whisper { color: var(--whisper); font-style: italic; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-family: 'Josefin Slab', serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
  padding: 0.85rem 1.9rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
  color: #fff;
  box-shadow: 0 10px 26px rgba(184, 55, 92, 0.45);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--card-line);
}
.btn-primary:hover { box-shadow: 0 14px 34px rgba(184, 55, 92, 0.6); }

/* ---------- Intro ---------- */
.intro {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.4rem;
  background:
    radial-gradient(1200px 600px at 50% -10%, #2a1330 0%, transparent 60%),
    radial-gradient(900px 500px at 50% 120%, #241033 0%, transparent 55%),
    var(--bg);
}
.intro-inner { max-width: 620px; position: relative; z-index: 2; }
.intro-body { margin: 2rem auto 2.4rem; max-width: 460px; }
.intro-body p { margin: 0.55rem 0; color: var(--ink-soft); }
.intro-body p:first-child {
  font-family: 'Dancing Script', cursive;
  font-size: 1.8rem;
  color: var(--ink);
}

/* ---------- Perjalanan ---------- */
.perjalanan { display: flex; flex-direction: column; background: var(--bg); }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.2rem;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--card-line);
  position: sticky;
  top: 0;
  z-index: 500;
}
.topbar-title { font-size: 0.95rem; letter-spacing: 0.06em; color: var(--ink-soft); }
.progress {
  font-size: 0.85rem;
  color: var(--gold);
  border: 1px solid var(--card-line);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
}

#map {
  width: 100%;
  height: 46vh;
  min-height: 300px;
  background: #10131a;
  z-index: 1;
}

.track {
  padding: 1.2rem 1rem 3rem;
  display: grid;
  gap: 0.9rem;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

/* ---------- Kartu Titik ---------- */
.point-card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 18px;
  padding: 1.1rem 1.2rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  box-shadow: var(--shadow);
  transition: border-color 0.25s ease, transform 0.2s ease, opacity 0.3s ease;
}
.point-card .num {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: 'Dancing Script', cursive;
  font-size: 1.5rem;
  background: #2a1c33;
  border: 1px solid var(--card-line);
  color: var(--rose);
}
.point-card .info { flex: 1 1 auto; min-width: 0; }
.point-card .info .label {
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.point-card .info .name {
  font-size: 1.25rem;
  color: var(--ink);
  margin: 0.1rem 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.point-card .info .state { font-size: 0.85rem; color: var(--whisper); }

/* status locked */
.point-card.locked { opacity: 0.75; }
.point-card.locked .num { color: var(--locked); background: #201826; }
.point-card.locked .name { color: var(--ink-soft); }

/* status ready (bisa dicek) */
.point-card.ready { border-color: var(--rose-deep); }
.point-card.ready .num { animation: pulse 2.2s infinite; }

/* status unlocked */
.point-card.unlocked { border-color: #3a6b4a; }
.point-card.unlocked .num {
  color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--rose-deep));
}
.point-card.unlocked .state { color: #8fce9f; }

.point-card .action {
  flex: 0 0 auto;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font-family: 'Josefin Slab', serif;
  font-size: 0.9rem;
  background: var(--rose-deep);
  color: #fff;
  transition: transform 0.15s ease, opacity 0.2s ease;
}
.point-card .action:active { transform: scale(0.94); }
.point-card .action.disabled {
  background: #2a2130;
  color: var(--locked);
  cursor: not-allowed;
}
.point-card .action.open { background: #2d5a3c; }

/* fallback manual link */
.manual-hint {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.78rem;
  color: var(--whisper);
  margin-top: -0.3rem;
}
.manual-hint a { color: var(--rose); cursor: pointer; text-decoration: underline; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 3, 9, 0.82);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  animation: fade 0.3s ease;
}
.modal-card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 22px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2rem 1.7rem;
  box-shadow: var(--shadow);
  position: relative;
  animation: rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  background: none;
  border: none;
  color: var(--whisper);
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
}
.modal-label {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}
.modal-title {
  font-family: 'Dancing Script', cursive;
  font-size: 2.4rem;
  color: var(--ink);
  margin: 0.2rem 0 0.1rem;
}
.modal-time { color: var(--whisper); font-style: italic; margin: 0 0 1.2rem; }
.modal-photo {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1.2rem;
}
.modal-photo img { width: 100%; display: block; }
.modal-story p { margin: 0 0 1rem; color: var(--ink-soft); }
.modal-story p:last-child { color: var(--ink); }
.modal-card .btn { width: 100%; text-align: center; margin-top: 0.4rem; }

/* ---------- Penutup ---------- */
.penutup {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.4rem;
  background:
    radial-gradient(1000px 500px at 50% -10%, #3a1030 0%, transparent 60%),
    var(--bg);
}
.penutup-inner { max-width: 620px; position: relative; z-index: 2; }
.penutup-body { margin: 1.6rem auto 2rem; max-width: 460px; }
.penutup-body p { margin: 0.6rem 0; color: var(--ink-soft); }
.penutup-body .vow {
  font-family: 'Dancing Script', cursive;
  font-size: 2rem;
  color: var(--rose);
  margin-top: 1rem;
}
.penutup .btn { margin-top: 1.8rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-soft);
  border: 1px solid var(--card-line);
  color: var(--ink);
  padding: 0.85rem 1.3rem;
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 2500;
  max-width: 90vw;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Floating hearts ---------- */
.floating-hearts { position: absolute; inset: 0; overflow: hidden; z-index: 1; pointer-events: none; }
.floating-hearts .h {
  position: absolute;
  bottom: -40px;
  font-size: 1.2rem;
  color: var(--rose);
  opacity: 0;
  animation: rise-heart linear infinite;
}

/* ---------- Leaflet marker ---------- */
.pin {
  font-size: 1.6rem;
  text-align: center;
  line-height: 1;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.5));
}
.pin.locked { filter: grayscale(1) opacity(0.5); }

.leaflet-popup-content-wrapper {
  background: var(--card);
  color: var(--ink);
  border-radius: 12px;
}
.leaflet-popup-content { font-family: 'Josefin Slab', serif; }
.leaflet-popup-tip { background: var(--card); }
.leaflet-container { background: #0e1119; }

/* ---------- Animations ---------- */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 86, 122, 0.5); }
  50% { box-shadow: 0 0 0 10px rgba(229, 86, 122, 0); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(30px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes rise-heart {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  15% { opacity: 0.9; }
  100% { transform: translateY(-110vh) scale(1.2); opacity: 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  body { font-size: 17px; }
  .point-card { padding: 0.9rem 1rem; gap: 0.7rem; }
  .point-card .num { width: 40px; height: 40px; font-size: 1.3rem; }
  .point-card .info .name { font-size: 1.1rem; }
  .point-card .action { padding: 0.55rem 0.8rem; font-size: 0.82rem; }
  #map { height: 40vh; }
  .modal-card { padding: 1.7rem 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}
