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

.tour-replay-btn {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

/* Desktop: keep the auto-hiding dock slid in while the tour points at it. */
@media (min-width: 1401px) {
  html.tour-open .icon-dock { transform: translateY(-50%) translateX(0); }
  html.tour-open .dock-tab { opacity: 0; pointer-events: none; }
}

.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;
  border-radius: 1rem;
  box-shadow: 0 0 0 200vmax rgba(2, 5, 14, 0.66);
  outline: 2px solid var(--accent-strong);
  outline-offset: 0;
  pointer-events: none;
  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-radius: inherit;
  border: 2px solid var(--accent-strong);
  box-shadow: 0 0 18px rgba(242, 214, 107, 0.45);
  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.05); }
}

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

@keyframes tour-tap {
  0%, 100% { transform: translate(10px, 16px) scale(1); }
  40%      { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(0, 0) scale(0.84); }
  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(370px, calc(100vw - 24px));
  padding: 1.05rem 1.15rem 0.95rem;
  border-radius: 1.2rem;
  background: linear-gradient(180deg, rgba(17, 24, 41, 0.94), rgba(10, 14, 28, 0.9));
  color: var(--text);
  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(-8px); }
  65%  { transform: translateY(0); }
  80%  { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}

/* The tree logo sits beside the step's title. */
.tour__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.5rem;
}
.tour__guide {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 77, 95, 0.35));
}

/* The welcome card's row of twinkling bulbs, in the scene's palette. */
.tour__bulbs {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  margin: 0.3rem 0 0.9rem;
}
.tour__bulbs[hidden] { display: none; }
.tour__bulb {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--bulb);
  box-shadow: 0 0 10px 2px var(--bulb);
  animation: tour-twinkle 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.22s);
}
.tour__bulb--up   { --bulb: #ff4d5f; }
.tour__bulb--down { --bulb: #3ef28f; }
.tour__bulb--flat { --bulb: #a6e6ec; }
.tour__bulb--idle { --bulb: #bdb7ff; }
.tour__bulb--gold { --bulb: #f2d66b; }
@keyframes tour-twinkle {
  0%, 100% { opacity: 1; transform: translateY(0); }
  30%      { opacity: 0.35; transform: translateY(-4px); }
  60%      { opacity: 1; transform: translateY(0); }
}

.tour__count { margin: 0 0 0.2rem; }
.tour__title {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.tour__body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--muted);
}

.tour__dots {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0.85rem 0 0.8rem;
}
.tour__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.2s, width 0.2s;
}
.tour__dot--done { background: rgba(125, 178, 255, 0.55); }
.tour__dot--active { width: 18px; background: var(--accent-strong); }

.tour__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.tour__spacer { flex: 1; }
.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__finger--tap,
  .tour__finger--tap::after,
  .tour__finger--swipe,
  .tour__card--enter,
  .tour__card--enter .tour__guide,
  .tour__bulb { animation: none; }
  .tour__finger--swipe { opacity: 1; }
}
