:root {
  --bg-void: #090a0e;
  --bg-card: rgba(18, 20, 27, 0.9);
  --bg-card-solid: #12141b;
  --bg-input: rgba(11, 12, 17, 0.92);
  --gold-bright: #f8df8c;
  --gold-main: #e8a825;
  --gold-deep: #a86d0b;
  --gold-border: rgba(232, 168, 37, 0.34);
  --gold-glow: rgba(232, 168, 37, 0.22);
  --crimson: #d93829;
  --text-main: #f5efe2;
  --text-muted: #b5aa94;
  --text-dim: #7f7665;
  --danger: #ff6b6b;
  --danger-bg: rgba(217, 56, 41, 0.14);
  --success: #4ade80;
  --font-display: "STKaiti", "KaiTi", "Songti SC", "Noto Serif SC", "PingFang SC", serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-void);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Ambient desktop backdrop */
.desktop-backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(232, 168, 37, 0.12), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(217, 56, 41, 0.08), transparent 40%),
    linear-gradient(145deg, #07080b 0%, #101219 50%, #07080b 100%);
  pointer-events: none;
}

.desktop-helper {
  display: none;
}

.h5-stage {
  position: relative;
  width: 100%;
  height: 100dvh;
  margin: 0 auto;
  background:
    radial-gradient(circle at 50% 0%, rgba(232, 168, 37, 0.14) 0%, transparent 52%),
    radial-gradient(circle at 85% 90%, rgba(168, 109, 11, 0.12) 0%, transparent 45%),
    linear-gradient(180deg, #0b0c11 0%, #11131b 50%, #090a0e 100%);
  overflow: hidden;
}

@media (min-width: 540px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }

  .desktop-helper {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    z-index: 20;
  }

  .helper-brand,
  .helper-actions {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(15, 17, 24, 0.85);
    border: 1px solid var(--gold-border);
    backdrop-filter: blur(10px);
  }

  .helper-brand strong {
    display: block;
    font-size: 0.85rem;
    color: var(--gold-bright);
  }

  .helper-brand span {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
  }

  .status-pill {
    font-size: 0.75rem;
    color: var(--text-muted);
  }

  .status-pill.is-cloud {
    color: var(--success);
  }

  .helper-btn {
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-main));
    color: #141008;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
  }

  .h5-stage {
    width: min(430px, 100%);
    height: min(860px, calc(100dvh - 88px));
    margin-top: 38px;
    border-radius: 26px;
    border: 1px solid var(--gold-border);
    box-shadow:
      0 28px 80px rgba(0, 0, 0, 0.75),
      0 0 0 1px rgba(248, 223, 140, 0.08) inset;
  }
}

/* Floating top bar */
.floating-chrome {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.page-counter,
.bgm-btn {
  pointer-events: auto;
}

.page-counter {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(9, 10, 14, 0.68);
  border: 1px solid rgba(232, 168, 37, 0.28);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--gold-bright);
  backdrop-filter: blur(8px);
}

.page-counter .divider,
.page-counter span:last-child {
  color: var(--text-dim);
}

.bgm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 12px 5px 7px;
  border-radius: 999px;
  border: 1px solid var(--gold-border);
  background: rgba(9, 10, 14, 0.76);
  color: var(--gold-bright);
  font-size: 0.78rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.bgm-btn:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.bgm-disc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(248, 223, 140, 0.22), rgba(232, 168, 37, 0.08));
  border: 1px solid rgba(248, 223, 140, 0.45);
}

.bgm-btn.is-playing .bgm-disc {
  animation: spinDisc 4.2s linear infinite;
}

.bgm-btn.is-muted {
  color: var(--text-dim);
  border-color: rgba(255, 255, 255, 0.16);
}

@keyframes spinDisc {
  to {
    transform: rotate(360deg);
  }
}

/* Right-edge dot indicator */
.slide-nav {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
}

.slide-nav ul {
  list-style: none;
  margin: 0;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 999px;
  background: rgba(9, 10, 14, 0.5);
}

.slide-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.slide-nav .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(245, 239, 226, 0.3);
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.slide-nav a[aria-current="location"] .dot {
  background: var(--gold-main);
  transform: scale(1.65);
  box-shadow: 0 0 8px var(--gold-main);
}

/* Scroll-snap container (proximity keeps overflow content reachable on tiny phones) */
.slides-viewport {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
}

.slides-viewport::-webkit-scrollbar {
  display: none;
}

.slide {
  position: relative;
  min-height: 100%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 58px 22px 44px;
  border-bottom: 1px solid rgba(232, 168, 37, 0.08);
}

.slide-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Page 1: Cover */
.slide-cover {
  background:
    radial-gradient(ellipse at 50% 24%, rgba(232, 168, 37, 0.16), transparent 58%),
    linear-gradient(180deg, rgba(9, 10, 14, 0.9) 0%, rgba(16, 18, 25, 0.96) 100%);
}

.cover-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.mountain-svg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 210px;
}

.moto-silhouette {
  position: absolute;
  right: -14px;
  bottom: 22px;
  width: 230px;
  height: auto;
}

.cover-inner {
  align-items: center;
  text-align: center;
  gap: 16px;
}

.logo-wrap {
  padding: 6px 10px 0;
}

.hero-logo {
  display: block;
  max-width: 245px;
  width: 72%;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 6px 18px rgba(232, 168, 37, 0.2));
}

.title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.52rem, 6.2vw, 2.15rem);
  font-weight: 800;
  line-height: 1.24;
  letter-spacing: 0.03em;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
}

.title-year-tag {
  font-family: var(--font-sans);
  font-size: 0.82em;
  color: var(--gold-main);
  vertical-align: 0.04em;
}

.gold-text {
  background: linear-gradient(135deg, #fff1ba 0%, #f1be46 48%, #c98614 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.meta-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(18, 20, 27, 0.75);
  border: 1px solid rgba(232, 168, 37, 0.22);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.meta-label {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.meta-item strong {
  font-size: 0.8rem;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.meta-divider {
  width: 1px;
  height: 26px;
  background: rgba(232, 168, 37, 0.25);
}

/* Countdown */
.countdown-card {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(24, 27, 36, 0.92), rgba(13, 15, 20, 0.96));
  border: 1px solid var(--gold-border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.countdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.countdown-target-text {
  font-variant-numeric: tabular-nums;
  color: var(--gold-main);
}

.countdown-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cd-box {
  flex: 1;
  padding: 8px 4px;
  border-radius: 10px;
  background: rgba(9, 10, 14, 0.85);
  border: 1px solid rgba(232, 168, 37, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cd-val {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--gold-bright);
}

.cd-unit {
  margin-top: 2px;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.cd-sep {
  color: var(--gold-main);
  font-weight: 700;
}

.cover-cta-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 2px;
}

/* Shared Buttons */
.btn-gold-primary,
.btn-gold-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.btn-gold-primary {
  border: none;
  background: linear-gradient(135deg, #f8df8c 0%, #e8a825 65%, #c78412 100%);
  color: #161106;
  box-shadow: 0 8px 22px rgba(232, 168, 37, 0.25);
}

.btn-gold-outline {
  border: 1px solid var(--gold-border);
  background: rgba(232, 168, 37, 0.08);
  color: var(--gold-bright);
}

.btn-gold-primary:active,
.btn-gold-outline:active {
  transform: scale(0.98);
}

.btn-gold-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-full {
  width: 100%;
}

.btn-sm {
  min-height: 40px;
  padding: 6px 16px;
  font-size: 0.88rem;
}

/* Section Headers */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-tag {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--gold-main);
  font-weight: 700;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--gold-bright);
  line-height: 1.25;
}

.section-desc {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Page 2: Highlights */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.kpi-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid rgba(232, 168, 37, 0.22);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi-num {
  font-size: 1.38rem;
  font-weight: 800;
  color: var(--gold-bright);
  line-height: 1.15;
}

.kpi-num small {
  font-size: 0.78rem;
  margin-left: 2px;
  color: var(--gold-main);
}

.kpi-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.feature-badge {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(232, 168, 37, 0.14);
  border: 1px solid var(--gold-border);
  color: var(--gold-bright);
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-card h3 {
  margin: 0 0 3px;
  font-size: 0.94rem;
  color: var(--text-main);
}

.feature-card p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.org-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(232, 168, 37, 0.1), rgba(18, 20, 27, 0.95));
  border: 1px solid var(--gold-border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
}

.org-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.org-role {
  color: var(--text-dim);
  flex-shrink: 0;
}

.org-row strong {
  color: var(--gold-bright);
  text-align: right;
}

.org-row span:last-child {
  color: var(--text-muted);
  text-align: right;
}

/* Page 3: Schedule & Navigation */
.day-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.day-tab {
  min-height: 48px;
  padding: 7px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 20, 27, 0.85);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-family: inherit;
}

.day-tab strong {
  font-size: 0.92rem;
  color: var(--text-main);
}

.day-tab span {
  font-size: 0.68rem;
}

.day-tab.active {
  border-color: var(--gold-main);
  background: rgba(232, 168, 37, 0.16);
}

.day-tab.active strong {
  color: var(--gold-bright);
}

.timeline-panels {
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid rgba(232, 168, 37, 0.2);
  padding: 12px 14px;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.timeline-list.compact {
  gap: 8px;
}

.timeline-list li {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 10px;
  align-items: start;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.timeline-list li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.tl-time {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--gold-main);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.tl-body strong {
  display: block;
  font-size: 0.86rem;
  color: var(--text-main);
}

.tl-body p {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.nav-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(24, 27, 36, 0.96), rgba(14, 15, 20, 0.96));
  border: 1px solid var(--gold-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.route-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--gold-bright);
  font-weight: 600;
}

.route-dist {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(217, 56, 41, 0.22);
  border: 1px solid rgba(217, 56, 41, 0.45);
  color: #ffb4ab;
  font-size: 0.7rem;
  white-space: nowrap;
}

.nav-addr {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.nav-btn-group {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 8px;
}

/* Page 4: Forms & Validation */
.live-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(232, 168, 37, 0.14);
  border: 1px solid var(--gold-border);
  color: var(--gold-bright);
  font-size: 0.75rem;
}

.gold-form,
.blessing-compose {
  padding: 14px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
}

.req {
  color: var(--crimson);
}

.hint {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(232, 168, 37, 0.3);
  background: var(--bg-input);
  color: var(--text-main);
  font: inherit;
  font-size: max(1rem, 1em);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.field textarea {
  min-height: 68px;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.stepper-row {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 8px;
}

.stepper-row input {
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stepper-btn {
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid var(--gold-border);
  background: rgba(232, 168, 37, 0.12);
  color: var(--gold-bright);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
}

.error-msg {
  display: none;
  font-size: 0.78rem;
  color: var(--danger);
}

/* Validate only after user interaction (:user-invalid + JS fallback) */
.field :is(input, textarea):is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--danger);
  background-color: var(--danger-bg);
}

.field:has(:is(input, textarea):is(:user-invalid, .user-invalid-fallback)) .error-msg {
  display: block;
}

.field :is(input, textarea):is(:user-valid, .user-valid-fallback) {
  border-color: rgba(74, 222, 128, 0.65);
}

.fee-summary-bar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(232, 168, 37, 0.08);
  border: 1px solid rgba(232, 168, 37, 0.28);
}

.fee-summary-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.fee-summary-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.fee-summary-total {
  font-size: 1.05rem;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}

.fee-summary-detail {
  font-size: 0.74rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* Page 5: Blessings Wall */
.compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.char-counter {
  font-size: 0.74rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.blessing-feed-wrap {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.blessing-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.blessing-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(18, 20, 27, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.blessing-item.is-pinned {
  border-color: var(--gold-border);
  background: linear-gradient(135deg, rgba(232, 168, 37, 0.12), rgba(18, 20, 27, 0.92));
}

.blessing-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.76rem;
}

.blessing-author {
  font-weight: 700;
  color: var(--gold-bright);
}

.pin-tag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(232, 168, 37, 0.22);
  color: var(--gold-bright);
  font-size: 0.68rem;
}

.blessing-time {
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.blessing-text {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-main);
  word-break: break-word;
}

.h5-footer {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid rgba(232, 168, 37, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.73rem;
  color: var(--text-muted);
}

.footer-brand p {
  margin: 0;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--text-dim);
}

.link-btn {
  background: none;
  border: none;
  padding: 4px 2px;
  color: var(--gold-main);
  font: inherit;
  font-size: 0.78rem;
  text-decoration: none;
  cursor: pointer;
}

/* Bottom Swipe Hint */
.swipe-hint {
  position: absolute;
  bottom: max(10px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: rgba(248, 223, 140, 0.72);
  pointer-events: none;
  animation: floatHint 1.8s ease-in-out infinite;
}

.swipe-hint.is-hidden {
  opacity: 0;
  visibility: hidden;
}

@keyframes floatHint {
  0%, 100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, 4px);
  }
}

/* Native <dialog> Modals */
dialog.gold-dialog {
  width: min(390px, calc(100vw - 32px));
  padding: 0;
  border-radius: 16px;
  border: 1px solid var(--gold-border);
  background: #13151d;
  color: var(--text-main);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
}

dialog.gold-dialog:modal {
  overscroll-behavior: contain;
}

dialog.gold-dialog::backdrop {
  background: rgba(4, 5, 8, 0.78);
  backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(232, 168, 37, 0.2);
}

.dialog-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--gold-bright);
}

.dialog-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.dialog-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-target-name {
  margin: 0;
  font-weight: 700;
  color: var(--gold-bright);
}

.nav-target-addr {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.map-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0;
}

.map-app-btn {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--gold-border);
  background: rgba(232, 168, 37, 0.08);
  color: var(--text-main);
  text-decoration: none;
}

.map-app-btn strong {
  font-size: 0.92rem;
  color: var(--gold-bright);
}

.map-app-btn span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.ticket-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(74, 222, 128, 0.14);
  border: 1px solid rgba(74, 222, 128, 0.45);
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 700;
}

.ticket-summary {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-main);
}

.ticket-tip {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ticket-actions {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.ticket-actions form button {
  width: 100%;
}

/* Popover Toast Notifications */
.toast-region {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  position: relative;
  inset: auto;
  margin: 0 auto;
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--gold-border);
  background: rgba(16, 18, 25, 0.96);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  transition-behavior: allow-discrete;
}

.toast-item:is(:popover-open, .is-open) {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

@starting-style {
  .toast-item:is(:popover-open, .is-open) {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 0.85rem;
}

@media (prefers-reduced-motion: reduce) {
  .slides-viewport {
    scroll-behavior: auto;
  }
  .bgm-btn.is-playing .bgm-disc,
  .swipe-hint {
    animation: none;
  }
  .toast-item {
    transition: none;
  }
}
