/* SIMAKARA LMS guided tour (game-tutorial style). Uses the same --ob-* tokens as onboarding.css. */
.tr-root {
  position: fixed; inset: 0; z-index: 10100; overflow: hidden; overscroll-behavior: contain;
  font-family: var(--ob-font, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif); color: var(--ob-text);
  -webkit-font-smoothing: antialiased;
}
.tr-root *, .tr-root *::before, .tr-root *::after { box-sizing: border-box; }
.tr-root.is-finale { background: rgba(20, 12, 8, .72); }
.tr-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* spotlight: the box-shadow dims everything except the target */
.tr-spot {
  position: fixed; display: none; border-radius: 16px; pointer-events: none;
  box-shadow: 0 0 0 100vmax rgba(20, 12, 8, .74);
  transition: left .35s cubic-bezier(.3, .8, .3, 1), top .35s cubic-bezier(.3, .8, .3, 1), width .35s cubic-bezier(.3, .8, .3, 1), height .35s cubic-bezier(.3, .8, .3, 1);
}
.tr-ring {
  position: fixed; display: none; border-radius: 16px; pointer-events: none;
  border: 3px solid #ffba66; box-shadow: 0 0 0 0 rgba(255, 186, 102, .65);
  animation: tr-pulse 1.6s ease-out infinite;
  transition: left .35s cubic-bezier(.3, .8, .3, 1), top .35s cubic-bezier(.3, .8, .3, 1), width .35s cubic-bezier(.3, .8, .3, 1), height .35s cubic-bezier(.3, .8, .3, 1);
}
@keyframes tr-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 186, 102, .7); } 80%, 100% { box-shadow: 0 0 0 16px rgba(255, 186, 102, 0); } }

/* bouncing pointer */
.tr-pointer { position: fixed; display: none; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; color: #ffba66; transform: translate(-50%, -100%); filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .45)); }
.tr-pointer svg { width: 28px; height: 28px; }
.tr-pointer-label { padding: 4px 10px; border-radius: 999px; background: #ffba66; color: var(--sk-on-primary); font: 900 12px/1.2 var(--ob-font, sans-serif); white-space: nowrap; }
.tr-pointer--top { animation: tr-bounce-down .9s ease-in-out infinite; }
.tr-pointer--bottom { flex-direction: column-reverse; transform: translate(-50%, 0); animation: tr-bounce-up .9s ease-in-out infinite; }
.tr-pointer--bottom svg { transform: rotate(180deg); }
@keyframes tr-bounce-down { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes tr-bounce-up { 0%, 100% { translate: 0 0; } 50% { translate: 0 8px; } }

/* tooltip card */
.tr-card {
  position: fixed; max-height: calc(100dvh - 24px); overflow-y: auto; padding: 18px; border-radius: 22px;
  background: var(--ob-surface); border: 2px solid var(--ob-accent); color: var(--ob-text);
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .6);
}
.tr-card--finale { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(380px, calc(100vw - 24px)) !important; text-align: center; z-index: 2; }
/* centered step: no spotlight, no pointer, the card carries the message on its own */
.tr-card--centered { text-align: center; }
.tr-card--centered .tr-actions { justify-content: center; }
.tr-head { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.tr-level { flex: none; display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--ob-accent); color: var(--sk-on-primary); font: 900 12px/1.3 var(--ob-font-display, sans-serif); letter-spacing: .04em; text-transform: uppercase; }
.tr-card--finale .tr-level { margin-bottom: 12px; }
.tr-xp { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
.tr-card--finale .tr-xp { margin: 0 0 14px; }
.tr-xp-bar { flex: 1 1 auto; height: 10px; border-radius: 999px; background: var(--ob-soft); border: 1px solid var(--ob-line); overflow: hidden; }
.tr-xp-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sk-primary), var(--sk-chart-4)); transition: width .45s cubic-bezier(.3, .8, .3, 1); }
.tr-xp-text { flex: none; font: 800 11px/1 var(--ob-font, sans-serif); color: var(--ob-muted); }
.tr-title { margin: 0 0 6px; font: 900 20px/1.2 var(--ob-font-display, sans-serif); letter-spacing: -.01em; color: var(--ob-text); }
.tr-text { margin: 0 0 14px; font-size: 14.5px; line-height: 1.6; color: var(--ob-muted); }
.tr-error { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--ob-err); }
.tr-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.tr-card--finale .tr-actions { justify-content: center; }
.tr-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--sk-primary-border); background: var(--ob-surface); color: var(--ob-text);
  font: 800 14px/1.2 var(--ob-font, sans-serif); cursor: pointer;
}
.tr-btn:hover:not(:disabled) { background: var(--ob-soft); }
.tr-btn:disabled { opacity: .55; cursor: progress; }
.tr-btn--primary { background: var(--ob-accent); color: var(--sk-on-primary); }
.tr-btn--primary:hover:not(:disabled) { background: var(--ob-accent); filter: brightness(1.06); }
.tr-btn--ghost { border-color: var(--ob-line-strong); }
.tr-btn--quiet { border-color: transparent; background: transparent; color: var(--ob-muted); text-decoration: underline; text-underline-offset: 3px; margin-right: auto; padding-left: 6px; padding-right: 6px; }
.tr-btn--quiet:hover:not(:disabled) { background: transparent; color: var(--ob-text); }
.tr-root :focus-visible { outline: 3px solid var(--ob-focus); outline-offset: 2px; }

/* confetti (CSS only) */
.tr-confetti-wrap { position: absolute; inset: 0; overflow: hidden; pointer-events: none; display: none; z-index: 1; }
.tr-confetti {
  position: absolute; top: -5vh; left: var(--x); width: var(--s); height: calc(var(--s) * 1.6); background: var(--c); border-radius: 2px;
  transform: rotate(var(--r)); animation: tr-fall var(--t) linear var(--d) infinite;
}
@keyframes tr-fall { 0% { transform: translate3d(0, 0, 0) rotate(var(--r)); opacity: 1; } 100% { transform: translate3d(calc(var(--s) * 4), 110vh, 0) rotate(calc(var(--r) + 540deg)); opacity: .9; } }

@media (prefers-reduced-motion: reduce) {
  .tr-ring, .tr-pointer, .tr-confetti { animation: none !important; }
  .tr-spot, .tr-ring, .tr-xp-bar i { transition: none !important; }
  .tr-confetti-wrap { display: none !important; }
}
