/* ── Tutorial overlay ─────────────────────────────────────────────────────── */

#tutorial-dim {
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 18, 0.55);
  backdrop-filter: blur(1px);
  z-index: 290;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

#tutorial-dim.visible { opacity: 1; }

/* ── Tutorial card ────────────────────────────────────────────────────────── */

#tutorial-card {
  position: fixed;
  z-index: 320;
  display: none;
  flex-direction: column;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 22px 16px;
  width: 300px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  animation: tut-fade-in 0.25s ease;
}

#tutorial-card.visible { display: flex; }

@keyframes tut-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tut-step-badge {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tut-step-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s;
}
.tut-step-close:hover { color: var(--text); }

.tut-title {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  color: var(--text);
  line-height: 1.25;
  margin: 0;
}

.tut-body {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}

.tut-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.tut-progress {
  flex: 1;
  display: flex;
  gap: 4px;
}

.tut-pip {
  height: 3px;
  flex: 1;
  border-radius: 99px;
  background: var(--border);
  transition: background 0.3s;
}

.tut-pip.done { background: var(--accent); }

.tut-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--text-dim);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  padding: 6px 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.tut-btn:hover { background: rgba(255,255,255,0.11); color: var(--text); }

.tut-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0d0d12;
  font-weight: 500;
}
.tut-btn-primary:hover { opacity: 0.85; background: var(--accent); color: #0d0d12; }

/* ── Highlight ring on targeted elements ─────────────────────────────────── */

.tutorial-highlight {
  position: relative;
  z-index: 295 !important;
  border-radius: 12px;
  box-shadow: 0 0 0 3px rgba(201, 184, 255, 0.5), 0 0 28px rgba(201, 184, 255, 0.25) !important;
  animation: tut-pulse 2s ease-in-out infinite;
}

@keyframes tut-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(201, 184, 255, 0.5), 0 0 28px rgba(201, 184, 255, 0.25); }
  50%       { box-shadow: 0 0 0 5px rgba(201, 184, 255, 0.35), 0 0 40px rgba(201, 184, 255, 0.18); }
}

/* SVG node highlight (can't use box-shadow on SVG circles, use filter) */
.tutorial-highlight-svg {
  filter: drop-shadow(0 0 8px rgba(201, 184, 255, 0.9)) drop-shadow(0 0 20px rgba(201, 184, 255, 0.5));
  animation: tut-pulse-svg 2s ease-in-out infinite;
}

@keyframes tut-pulse-svg {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(201, 184, 255, 0.9)) drop-shadow(0 0 20px rgba(201, 184, 255, 0.5)); }
  50%       { filter: drop-shadow(0 0 12px rgba(201, 184, 255, 1))  drop-shadow(0 0 32px rgba(201, 184, 255, 0.6)); }
}

/* ── Tutorial trigger button ─────────────────────────────────────────────── */

#tutorial-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
  margin-left: 6px;
}
#tutorial-btn:hover { opacity: 1; color: var(--text); border-color: rgba(255,255,255,0.15); }
