/* ── First-visit tour (ui/tour.js) ─────────────────────────────────
   Above every modal (1000) and SweetAlert (1060). The spotlight is a box
   whose huge spread shadow dims everything else; it glides between targets. */

.tour-replay-btn {
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.tour {
  position: fixed;
  inset: 0;
  z-index: 1300;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.tour--open { opacity: 1; }

.tour__blocker {
  position: absolute;
  inset: 0;
}

.tour__spot {
  position: fixed;
  box-shadow: 0 0 0 200vmax rgba(33, 24, 14, 0.62);
  outline: 2px solid var(--avatar-bg);
  outline-offset: 0;
  pointer-events: none;
  /* Same duration and ease-in-out as <px-town>'s focusLandmark() glide, so
     on town steps the hole and the map arrive together. */
  transition: left 0.45s cubic-bezier(.45, 0, .55, 1), top 0.45s cubic-bezier(.45, 0, .55, 1),
              width 0.45s cubic-bezier(.45, 0, .55, 1), height 0.45s cubic-bezier(.45, 0, .55, 1);
}
.tour__spot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border: 2px solid var(--avatar-bg);
  animation: tour-ring 1.6s ease-out infinite;
}
.tour__spot--empty { outline-color: transparent; }
.tour__spot--empty::after { display: none; }

@keyframes tour-ring {
  from { opacity: 0.9; transform: scale(1); }
  to   { opacity: 0;   transform: scale(1.06); }
}

/* The paw demonstrating a tap (press + ripple) or a swipe (slide across). */
.tour__paw {
  position: fixed;
  display: none;
  font-size: 1.9rem;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
  translate: -50% -50%;
}
.tour__paw--tap,
.tour__paw--swipe { display: block; }
.tour__paw--tap { animation: tour-tap 1.4s ease-in-out infinite; }
.tour__paw--swipe { animation: tour-swipe 1.8s ease-in-out infinite; }
.tour__paw--tap::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.6rem;
  height: 2.6rem;
  margin: -1.3rem 0 0 -1.3rem;
  border-radius: 50%;
  border: 2px solid #fff;
  opacity: 0;
  animation: tour-ripple 1.4s ease-out infinite;
}

@keyframes tour-tap {
  0%, 100% { transform: translate(14px, 14px) scale(1); }
  40%      { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(0, 0) scale(0.82); }
  62%      { transform: translate(0, 0) scale(1); }
}
@keyframes tour-ripple {
  0%, 48% { opacity: 0; transform: scale(0.4); }
  52%     { opacity: 0.9; transform: scale(0.5); }
  100%    { opacity: 0; transform: scale(1.6); }
}
@keyframes tour-swipe {
  0%   { transform: translateX(var(--swipe)); opacity: 0; }
  15%  { transform: translateX(var(--swipe)); opacity: 1; }
  70%  { transform: translateX(calc(var(--swipe) * -1)); opacity: 1; }
  85%, 100% { transform: translateX(calc(var(--swipe) * -1)); opacity: 0; }
}

.tour__card {
  position: fixed;
  width: min(360px, calc(100vw - 24px));
  padding: 1.1rem 1.15rem 0.95rem;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--wood-dark);
  box-shadow: var(--shadow-soft-lg);
  transition: left 0.45s cubic-bezier(.4, 0, .2, 1), top 0.45s cubic-bezier(.4, 0, .2, 1);
}
.tour__card--enter { animation: tour-card-in 0.35s ease-out; }
.tour__card--enter .tour__guide { animation: tour-hop 0.5s ease-out; }

@keyframes tour-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes tour-hop {
  0%   { transform: translateY(0); }
  35%  { transform: translateY(-10px); }
  65%  { transform: translateY(0); }
  80%  { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

/* The guide cat sits beside the step's title. */
.tour__head {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}
.tour__guide { flex: none; }
.tour__guide[hidden] { display: none; }

/* The welcome card's parade of cats, hopping in turn. */
.tour__parade {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 0.2rem 0 0.6rem;
}
.tour__parade[hidden] { display: none; }
.tour__parade px-cat {
  animation: tour-parade 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.18s);
}
@keyframes tour-parade {
  0%, 60%, 100% { transform: translateY(0); }
  20%           { transform: translateY(-9px); }
  40%           { transform: translateY(0); }
}

.tour__count {
  margin: 0 0 0.15rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted);
}
.tour__title {
  margin: 0;
  font-family: 'Pixelify Sans', sans-serif;
  font-size: 1.2rem;
  color: var(--ink);
}
.tour__body {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--body-text);
}

.tour__dots {
  display: flex;
  gap: 5px;
  margin: 0.8rem 0 0.75rem;
}
.tour__dot {
  width: 7px;
  height: 7px;
  background: var(--progress-track);
  border: 1px solid var(--progress-track-border);
  transition: background 0.2s, width 0.2s;
}
.tour__dot--done { background: var(--panel-border-strong); }
.tour__dot--active { width: 18px; background: var(--accent); border-color: var(--accent-strong); }

.tour__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.tour__spacer { flex: 1; }
.tour__actions .button { padding: 0.4rem 0.8rem; }
.tour__actions [hidden] { display: none; }
.tour__skip { border-color: transparent; background: transparent; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .tour,
  .tour__spot,
  .tour__card { transition: none; }
  .tour__spot::after,
  .tour__paw--tap,
  .tour__paw--tap::after,
  .tour__paw--swipe,
  .tour__card--enter,
  .tour__card--enter .tour__guide,
  .tour__parade px-cat { animation: none; }
  .tour__paw--swipe { opacity: 1; }
}
