/* ════════════════════════════════════════════════════════════════════════
   Welcome splash + guided tour
   The dimming layer is an SVG rect masked by a cut-out path, which lets the
   highlight take a shape rather than a rectangle: a settings panel is lit
   together with the tab that opens it, joined by a filleted notch.
   ═══════════════════════════════════════════════════════════════════════ */

.tour-root {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

/* The root never captures pointer events, only the card does. The cut-out is a
   real hole in the dimming layer, so the highlighted control stays bright and
   usable and the user can keep playing with the sim while the tour is open. */
.tour-root.is-active {
  opacity: 1;
}

/* ── Spotlight ────────────────────────────────────────────────────── */
/* The dim layer is an SVG rect masked by a cut-out path, so the highlight can
   follow a shape (a panel plus the tab that opens it) rather than being limited
   to a rectangle. The path is tweened in JS; only the accent edge animates in
   CSS. */

.tour-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.tour-scrim {
  fill: rgba(6, 9, 14, 0.62);
}

.tour-outline {
  stroke: var(--accent-line);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 8px rgba(61, 220, 132, 0.35));
  opacity: 0.9;
}

/* Centred welcome/finish steps dim everything with no cut-out at all. */
.tour-root.is-centered .tour-outline {
  opacity: 0;
}

.tour-root.is-active:not(.is-centered) .tour-outline {
  animation: tour-edge 2.4s var(--ease) infinite;
}

@keyframes tour-edge {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}

/* ── Tooltip card ─────────────────────────────────────────────────── */

.tour-card {
  position: absolute;
  width: min(390px, calc(100vw - 32px));
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  /* Extra right padding keeps the title clear of the Skip button. */
  padding: 20px 64px 16px 20px;
  pointer-events: auto;
  transition: top 0.5s var(--ease-out), left 0.5s var(--ease-out),
              opacity 0.3s var(--ease), transform 0.3s var(--ease-out);
}

.tour-card.is-swapping {
  opacity: 0;
  transform: translateY(6px);
}

/* Welcome / finale steps get a larger, centred treatment. */
.tour-card.is-hero {
  width: min(520px, calc(100vw - 32px));
  padding: 30px 30px 22px;
  text-align: center;
}

.tour-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 7px;
}

.tour-title {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.tour-card.is-hero .tour-title {
  font-size: 26px;
}

.tour-body {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-mid);
}

.tour-body strong {
  color: var(--text);
  font-weight: 600;
}

.tour-body kbd {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--glass-sunken);
  color: var(--text);
}

/* ── Footer: progress + controls ──────────────────────────────────── */

.tour-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.tour-card.is-hero .tour-footer {
  justify-content: center;
}

.tour-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.tour-card.is-hero .tour-dots {
  display: none;
}

.tour-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: width var(--dur) var(--ease), background var(--dur) var(--ease);
}

.tour-dot:hover {
  background: var(--text-dim);
}

.tour-dot.is-current {
  width: 18px;
  background: var(--accent);
}

.tour-dot.is-done {
  background: var(--accent-line);
}

.tour-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tour-btn {
  border: 1px solid var(--border);
  background: var(--glass-sunken);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--r-md);
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
}

.tour-btn:hover {
  background: var(--glass-hover);
  border-color: var(--border-strong);
}

.tour-btn--primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}

.tour-btn--primary:hover {
  filter: brightness(1.08);
  box-shadow: var(--accent-glow);
}

.tour-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
  padding: 9px 10px;
}

.tour-btn--ghost:hover {
  background: var(--glass-sunken);
  color: var(--text);
}

.tour-btn[hidden] {
  display: none;
}

/* Skip sits in the card's top-right corner, deliberately quieter than Back and
   Next so it never competes with the step you are meant to read. */
.tour-skip {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 500;
  border-radius: var(--r-sm);
  padding: 4px 8px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--dur) var(--ease), color var(--dur) var(--ease),
              background var(--dur) var(--ease);
}

.tour-skip:hover,
.tour-skip:focus-visible {
  opacity: 1;
  color: var(--text-mid);
  background: var(--glass-sunken);
}

.tour-step-count {
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  margin-right: 2px;
}

.tour-card.is-hero .tour-step-count {
  display: none;
}

@media (max-width: 720px) {
  .tour-card,
  .tour-card.is-hero {
    left: 16px !important;
    right: 16px;
    width: calc(100vw - 32px);
    padding: 20px 18px 14px;
  }

  .tour-card.is-hero .tour-title { font-size: 22px; }

  .tour-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  .tour-actions { width: 100%; }
  .tour-btn { flex: 1; text-align: center; }
}
