/* ============================================
   GRINDVEIL — Tutorial / Onboarding System v5
   Single-scene animated flow. A dim layer covers the UI, a spotlight ring
   cuts a hole over the element being described, and the ring smoothly slides
   between targets between steps. Narrator panel fades text in/out on step.
   ============================================ */

.tut-root {
  position: fixed; inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.tut-root.tut-root-ready { opacity: 1; }
.tut-root.tut-fade-out { opacity: 0; }

/* Full-screen dimmer. The spotlight RING casts a large outer shadow that
   ends up _being_ the dim overlay over the rest of the screen, so the dim
   layer here is just a fallback for the "no target" (welcome) step. */
.tut-dim {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(10,5,25,0.68), rgba(4,2,10,0.82));
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

/* Spotlight ring — uses box-shadow spread as a "cutout" on the dim overlay.
   Transitioning left/top/width/height animates it between targets. */
.tut-ring {
  position: fixed;
  left: 50%; top: 50%;
  width: 0; height: 0;
  border-radius: 14px;
  border: 2px solid rgba(255,216,144,0.85);
  box-shadow:
    0 0 0 9999px rgba(8,4,18,0.78),
    0 0 28px rgba(255,216,144,0.55),
    inset 0 0 22px rgba(255,216,144,0.18);
  pointer-events: none;
  z-index: 9991;
  transition: left 0.5s cubic-bezier(.4,0,.2,1),
              top 0.5s cubic-bezier(.4,0,.2,1),
              width 0.5s cubic-bezier(.4,0,.2,1),
              height 0.5s cubic-bezier(.4,0,.2,1),
              opacity 0.3s ease;
  animation: tutRingPulse 2.6s ease-in-out infinite;
}

/* When there is no target (welcome step) we hide the ring and let the dim
   layer take over. `visibility` keeps the transition target-less. */
.tut-ring.tut-ring-hidden {
  opacity: 0;
  width: 0; height: 0;
  box-shadow: 0 0 0 9999px rgba(8,4,18,0.78);
}

@keyframes tutRingPulse {
  0%, 100% { border-color: rgba(255,216,144,0.65); }
  50%      { border-color: rgba(255,216,144,1);    }
}

/* v23.0.722 — removed rotating conic-gradient sweep (user feedback:
   "animacja krecenia sie paska nie pasuje"). Static golden glow only. */
.tut-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 16px;
  box-shadow: 0 0 28px 4px rgba(255,216,144,0.35);
  pointer-events: none;
  z-index: -1;
}

/* Narrator panel */
.tut-narrator {
  position: fixed;
  z-index: 9995;
  pointer-events: auto;
  max-width: 520px;
  width: calc(100vw - 24px);
  background: linear-gradient(180deg, rgba(30,20,55,0.98), rgba(14,8,28,0.98));
  border: 1px solid rgba(200,168,78,0.45);
  border-radius: 16px;
  box-shadow:
    0 12px 48px rgba(0,0,0,0.7),
    0 0 28px rgba(200,168,78,0.18),
    inset 0 1px 0 rgba(255,255,255,0.05);
  transition: top 0.45s cubic-bezier(.4,0,.2,1),
              left 0.45s cubic-bezier(.4,0,.2,1),
              bottom 0.45s cubic-bezier(.4,0,.2,1),
              opacity 0.25s ease,
              transform 0.25s ease;
}

/* "No target" (welcome) layout — center the card */
.tut-narrator.tut-nar-center {
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 32px));
}

.tut-narrator.tut-nar-fading .tut-nar-inner {
  opacity: 0;
  transform: translateY(6px);
}

.tut-nar-inner {
  padding: 20px 22px 18px;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.tut-nar-step {
  font-family: var(--font-display, Cinzel, serif);
  font-size: 10px; font-weight: 700;
  letter-spacing: 2.2px;
  color: rgba(200,168,78,0.7);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.tut-nar-title {
  font-family: var(--font-display, Cinzel, serif);
  font-size: 20px; font-weight: 900;
  color: #ffd890;
  letter-spacing: 1px;
  margin-bottom: 10px;
  text-shadow: 0 0 14px rgba(255,216,144,0.3);
  line-height: 1.2;
}

.tut-nar-text {
  font-size: 13.5px; font-weight: 500;
  color: #d0c2e0;
  line-height: 1.65;
  margin-bottom: 14px;
}

.tut-nar-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.tut-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.tut-dot.tut-dot-done {
  background: rgba(200,168,78,0.55);
}
.tut-dot.tut-dot-active {
  background: #ffd890;
  transform: scale(1.5);
  box-shadow: 0 0 10px rgba(255,216,144,0.8);
}

.tut-nar-btns {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tut-nar-skip {
  padding: 11px 18px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #8a7ca8;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  font-family: inherit;
}
.tut-nar-skip:hover {
  color: #c0b0d8;
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.03);
}

.tut-nar-next {
  flex: 1;
  padding: 12px 22px;
  background: linear-gradient(135deg, #ffd890, #c8a84e);
  border: none;
  border-radius: 10px;
  color: #1a0e00;
  font-family: var(--font-display, Cinzel, serif);
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 1.2px;
  cursor: pointer;
  transition: filter 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(255,216,144,0.25);
}
.tut-nar-next:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(255,216,144,0.4);
}
.tut-nar-next:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

/* Mobile */
@media (max-width: 720px) {
  .tut-narrator {
    max-width: none;
    width: auto;
  }
  .tut-nar-inner { padding: 16px 18px 14px; }
  .tut-nar-title { font-size: 17px; margin-bottom: 8px; }
  .tut-nar-text { font-size: 12.5px; line-height: 1.55; margin-bottom: 12px; }
  .tut-nar-next { padding: 11px 18px; font-size: 12.5px; }
  .tut-nar-skip { padding: 11px 14px; font-size: 11.5px; }
}
