/* Tour mode: kartu caption bawah-tengah + sembunyikan dock/legend selama body.touring. Token dari ui.css. */
.tour-caption {
  position: fixed;
  left: 50%;
  bottom: 40px;
  z-index: 30;
  width: max-content;
  max-width: min(760px, calc(100vw - 32px));
  padding: 14px 24px 16px;
  text-align: center;
  background: var(--paper-glass, rgba(244, 241, 232, 0.9));
  border: 1px solid var(--hairline, #D9D3C4);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(35, 34, 28, 0.04), 0 10px 30px -18px rgba(35, 34, 28, 0.35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--ink, #23221C);
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity .32s ease, transform .32s ease;
  pointer-events: none;
}
.tour-caption.is-on { opacity: 1; transform: translate(-50%, 0); }
.tour-caption__sub {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ink, #23221C);
  color: var(--paper, #F4F1E8);
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.tour-caption__text {
  margin: 0;
  font-family: var(--font-serif, "Playfair Display", Georgia, serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.005em;
  font-variant-numeric: lining-nums;   /* Playfair default angka old-style: '0' kebaca 'o' */
  text-wrap: balance;
}
.tour-caption__dots { display: flex; justify-content: center; gap: 5px; margin-top: 10px; }
.tour-caption__dots:empty { display: none; }
.tour-caption__dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--hairline, #D9D3C4); }
.tour-caption__dots i.is-on { background: var(--orange, #F54E00); }

/* Selama tour: dock (legend + chip ruang) disembunyikan; HUD atas tetap (statistik hidup buat klip) */
body.touring .dock { opacity: 0; pointer-events: none; transition: opacity .3s ease; }
body.touring #world { cursor: default; }

@media (max-width: 900px) {
  .tour-caption { bottom: 20px; padding: 12px 16px 14px; }
  .tour-caption__text { font-size: 20px; }
}

/* ---------- Kartu opener/outro (DOM overlay, kertas full-bleed, bingkai hairline) ----------
   Dikendalikan event langkah tour; fade cuma transisi CSS 300 ms → aman di jam virtual perekam. */
.tour-card {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper, #F4F1E8);
  color: var(--ink, #23221C);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.tour-card.is-on { opacity: 1; pointer-events: auto; }
.tour-card__frame {
  position: absolute;
  inset: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 48px;
  text-align: center;
  border: 1px solid var(--hairline, #D9D3C4);
  box-sizing: border-box;
}
.tour-card__frame::before, .tour-card__frame::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 1px;
  height: 36px;
  background: var(--hairline, #D9D3C4);
}
.tour-card__frame::before { top: -1px; transform: translateY(-100%); }
.tour-card__frame::after { bottom: -1px; transform: translateY(100%); }
.tour-card__title {
  margin: 0;
  font-family: var(--font-serif, "Playfair Display", Georgia, serif);
  font-size: 72px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.tour-card__chip {
  display: inline-block;
  max-width: 24ch;
  padding: 6px 12px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--paper, #F4F1E8);
  background: var(--ink, #23221C);
  text-wrap: balance;
}
.tour-card__line {
  margin: 0;
  font-family: var(--font-serif, "Playfair Display", Georgia, serif);
  font-style: italic;
  font-size: 36px;
  font-weight: 500;
  line-height: 1.2;
  text-wrap: balance;
}
.tour-card__tiny {
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-muted, #6B675E);
}
.tour-card [hidden] { display: none; }
.tour-card[data-kind="outro"] .tour-card__title { font-size: 28px; letter-spacing: .02em; }

/* ---------- Chip judul story (atas): cuma di body.story ---------- */
.story-title {
  display: none;
  position: fixed;
  left: 50%;
  top: clamp(250px, 14.6vh, 320px);          /* 1920 px → 280; batas atas IG Story = 250 px */
  z-index: 30;
  transform: translateX(-50%);
  padding: 8px 16px;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink, #23221C);
  background: var(--paper-glass, rgba(244, 241, 232, 0.9));
  border: 1px solid var(--hairline, #D9D3C4);
  border-left: 3px solid var(--orange, #F54E00);
  border-radius: 2px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: none;
  white-space: nowrap;
}
body.story .story-title { display: block; }

/* ---------- Story 9:16 (1080×1920): zona aman IG = 250 px atas, 340 px bawah ----------
   Kartu caption nempel di bottom 360 px (tepi bawah ≥ 340 px), tumbuh ke atas; tipografi gede buat HP. */
body.story .tour-caption {
  bottom: clamp(340px, 18.75vh, 420px);      /* 1920 px → 360 */
  max-width: calc(100vw - 96px);
  padding: 26px 36px 30px;
  border-radius: 6px;
}
body.story .tour-caption__sub { font-size: 20px; padding: 6px 16px; margin-bottom: 16px; letter-spacing: .1em; }
body.story .tour-caption__text { font-size: 48px; line-height: 1.18; }
body.story .tour-caption__dots { display: none; }
body.story .tour-card__title { font-size: 128px; }
body.story .tour-card[data-kind="outro"] .tour-card__title { font-size: 40px; }
body.story .tour-card__chip { font-size: 22px; padding: 10px 20px; max-width: 26ch; }
body.story .tour-card__line { font-size: 56px; }
body.story .tour-card__tiny { font-size: 20px; }
body.story .tour-card__frame { gap: 34px; }

@media (prefers-reduced-motion: reduce) { .tour-caption, .tour-card { transition: none; } }
