.tour-spotlighted {
  position: relative !important;
  z-index: 90 !important;
  outline: 3px solid var(--accent, #00a2ec);
  outline-offset: 4px;
}

#tour-card {
  position: fixed;
  z-index: 399; /* lower than sidebar and sidebar-overlay, but higher than title and spotlight  */
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-top: 15px;
  width: 270px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
  transition: top .3s ease, left .3s ease, opacity .3s ease;
}

#tour-card.tour-card-dragging {
  transition: opacity .3s ease;
}

#tour-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
#tour-card-header:active {
  cursor: grabbing;
}
#tour-title {
  margin: 0;
}
#tour-drag-icon {
  display: none;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: .15rem;
  fill: var(--muted, #8a8f9a);
}

#tour-card::after {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #fff;
}

#tour-card.tour-card-above::after {
  top: auto;
  bottom: -10px;
  border-bottom: none;
  border-top: 10px solid #fff;
}

#tour-card.tour-card-anchor::after {
  display: none;
}

#tour-card h4 {
  margin: 0 0 .35rem;
  font-size: .95rem;
  color: var(--text, #e8e9ec);
}

#tour-card p {
  margin: 0 0 .9rem;
  font-size: .9rem;
  color: var(--muted, #8a8f9a);
  line-height: 1.45;
}

.tour-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tour-progress {
  font-size: .7rem;
  color: var(--muted, #8a8f9a);
}

.btn.skip-tour {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: #fff;
  border: 1px solid #bbb;
  color: #bbb;
  font-size: 12px;
  padding: 5px 8px;
  z-index: 10;
}

.tour-next {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent, #00a2ec);
  border: none;
  border-radius: 6px;
  padding: .4rem .8rem;
  cursor: pointer;
}

.tour-waiting-hint {
  font-size: .9rem;
  color: var(--accent, #00a2ec);
  font-weight: 600;
}

#map-container {
  background: transparent;
  border: 0;
  overflow: hidden;
  border-radius: 12px;
  position: relative;
}

#tour-map-panzoom {
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
#tour-map-panzoom:active { cursor: grabbing; }

#tour-map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

#tour-map-svg .tour-greyed {
  opacity: .18;
  transition: opacity .4s ease;
}

#tour-map-svg .tour-dimmed {
  opacity: .55;
  transition: opacity .4s ease;
}

#tour-map-svg circle[data-lines].tour-greyed,
#tour-map-svg rect[data-lines].tour-greyed {
  opacity: 1;
  stroke-opacity: .18;
}
#tour-map-svg circle[data-lines].tour-dimmed,
#tour-map-svg rect[data-lines].tour-dimmed {
  opacity: 1;
  stroke-opacity: .55;
}

#tour-pulse {
  display: none;
  pointer-events: none;
  fill: none;
  stroke: var(--accent, #00a2ec);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  r: 4;
  transform-box: fill-box;
  transform-origin: center;
  animation: tour-pulse-ring 1.6s ease-out infinite;
}

#tour-pulse.active { display: block; }

@keyframes tour-pulse-ring {
  0%   { transform: scale(1);   stroke-opacity: 1; }
  55%  { stroke-opacity: 1; }
  100% { transform: scale(5.5); stroke-opacity: 0; }
}

#tour-pulse-dot {
  display: none;
  pointer-events: none;
  fill: var(--accent, #00a2ec);
  stroke: #fff;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
#tour-pulse-dot.active { display: block; }

.tour-map-note {
  text-align: center;
  font-size: .7rem;
  color: var(--muted, #8a8f9a);
  margin-top: .4rem;
}

.game-panel {
  overflow: initial;
}

#tour-finished-popup {
  position: fixed;
  z-index: 1505;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 12px;
  padding: .9rem 1.1rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .6rem 1rem;
  max-width: calc(100vw - 24px);
}

#tour-finished-popup p {
  margin: 0;
  font-size: .9rem;
  color: var(--text, #1a1a1a);
  white-space: nowrap;
  flex-basis: 100%;
  text-align: center;
}

.tour-restart {
  background: #bbb;
  color: #fff;
}

.sidebar {
  z-index: 1501;
}

@media (max-width:600px) {

  #tour-card.menu::after {
    left: initial;
    right: 10px;
  }

  #tour-drag-icon {
    display: block;
  }

}
