/* First-launch tour overlay (tour.js, 2026-10-26). Full-screen takeover,
   same z-index tier as the other full-screen sheets (week.css), built from
   card/styles.css's own tokens so it reads as part of the app, not a bolt-on. */

.tour {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transition: background 0.2s ease;
}

/* A step with a real target: dim the page instead of hiding it, so the
   spotlighted element (lifted above this layer — see .tour-spotlight-target
   below) reads as "that thing, right there" against its own real surroundings. */
.tour--spotlight {
  background: rgba(8, 8, 8, 0.86);
}

/* The real page element a step points at. Lifted above .tour's z-index
   with its own glow, in its normal on-page position — not a clone, not
   moved — so what's highlighted is exactly where the client will find it
   once the tour's over. */
.tour-spotlight-target {
  position: relative;
  z-index: 201;
  border-radius: var(--radius, var(--radius-sm));
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--red), 0 0 36px 6px rgba(224, 0, 0, 0.45);
  animation: tour-pulse 1.8s ease-in-out infinite;
}

@keyframes tour-pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--red), 0 0 36px 6px rgba(224, 0, 0, 0.45); }
  50% { box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--red), 0 0 48px 10px rgba(224, 0, 0, 0.6); }
}

@media (prefers-reduced-motion: reduce) {
  .tour-spotlight-target {
    animation: none;
  }
}

.tour__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 18px 10px;
}

.tour__dots {
  display: flex;
  gap: 7px;
}

.tour__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.tour__dot.is-active {
  background: var(--red);
  width: 20px;
}

.tour__skip {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--dim);
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 8px;
  min-height: 44px;
}

/* Default (no target this step): a plain centered card filling the space
   between the top bar and the Next/Back row — welcome and closing only. */
.tour__card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 28px 10px;
  gap: 14px;
  overflow-y: auto;
}

/* Pointing at a real element: a small floating callout near it instead of
   filling the screen, positioned by tour.js (top/left + the arrow's own
   offset, via --tour-arrow-left) once it knows the target's real position. */
.tour__card--pointing {
  position: fixed;
  flex: none;
  width: min(300px, calc(100vw - 32px));
  max-height: 60vh;
  align-items: flex-start;
  text-align: left;
  padding: 18px 20px;
  gap: 8px;
  background: var(--bg-card, #1c1c1c);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.14));
  border-radius: var(--radius, var(--radius-sm));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.tour__card--pointing::before {
  content: "";
  position: absolute;
  left: var(--tour-arrow-left, 50%);
  width: 14px;
  height: 14px;
  background: var(--bg-card, #1c1c1c);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.14));
  transform: translateX(-50%) rotate(45deg);
}

.tour__card--pointing.tour__card--below::before {
  top: -8px;
  border-right: none;
  border-bottom: none;
}

.tour__card--pointing.tour__card--above::before {
  bottom: -8px;
  border-left: none;
  border-top: none;
}

.tour__icon {
  width: 84px;
  height: 84px;
  border-radius: 999px;
  background: var(--glass-bg, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  flex-shrink: 0;
}

.tour__icon svg {
  width: 38px;
  height: 38px;
}

.tour__eyebrow {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  font-size: 14px;
  color: var(--red);
  margin: 0;
}

.tour__headline {
  font-family: var(--font-head);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: 28px;
  color: var(--white);
  margin: 0;
  line-height: 1.08;
}

.tour__text {
  font-size: 17px;
  line-height: 1.55;
  color: var(--grey);
  margin: 0;
  max-width: 34ch;
}

.tour__text b {
  color: var(--white);
}

/* The pointing callout is much narrower than the centered welcome/closing
   card, so its headline/text read at a smaller, left-aligned scale rather
   than overflowing a 300px box. */
.tour__card--pointing .tour__headline {
  font-size: 19px;
}

.tour__card--pointing .tour__text {
  font-size: 15px;
  max-width: none;
}

.tour__bottom {
  padding: 14px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 10px;
}

.tour__back {
  flex: 0 0 auto;
  min-width: 52px;
  min-height: 52px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--white);
  font-size: 20px;
  cursor: pointer;
}

.tour__back[hidden] {
  display: none;
}

.tour__next {
  flex: 1;
  min-height: 52px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--red);
  color: var(--on-red);
  font-family: var(--font-head);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 16px;
  cursor: pointer;
}

/* The "watch it again" link on the Profile tab. */
.card__replay-tour {
  display: block;
  text-align: center;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--grey);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 8px;
  margin: 0 auto;
  min-height: 48px;
}
