/* =============================================================
   tutorialEngine.css — single shared visual layer for every
   tutorial in the game (see scripts/tutorialEngine.js).

   Two modes share these styles:
   - "blocking" mode (#ob-backdrop / #ob-tut-popup / #tutorial-cursor):
     persistent 4-panel cutout + Skip popup + hand cursor, used by the
     main gameplay onboarding flow (it ticks every frame and physically
     blocks stray taps outside the highlighted target).
   - "dim" mode (.tut-overlay / .tut-hole / .tut-label / .tut-arrow /
     .tut-click-indicator): a lightweight one-shot highlight used by
     every contextual tutorial (galaxy, boss, companions, cosmetics...).
     Non-blocking — pointer-events:none, the real click underneath both
     dismisses the tutorial and performs the real game action.

   .ob-spotlight (the pulsing highlight ring) is shared by both modes.
   ============================================================= */

.ob-spotlight {
  position: relative;
  border-radius: 10px;
  animation: ob-spotlight-pulse 1.6s ease-in-out infinite;
}

@keyframes ob-spotlight-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(80, 200, 255, 0.85), 0 0 18px rgba(80, 200, 255, 0.35); }
  50%      { box-shadow: 0 0 0 3px rgba(61, 255, 160, 0.9),  0 0 30px rgba(61, 255, 160, 0.45); }
}

/* ── BLOCKING MODE — dark cutout backdrop (4 panels around the target) ──
   Panels capture pointer events so the ONLY thing the player can tap is
   the target (or Skip). A glowing ring traces the gap. */

#ob-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

.ob-bd-panel {
  position: fixed;
  background: rgba(2, 6, 20, 0.82);
  pointer-events: auto;
  transition: left 0.28s ease, top 0.28s ease, width 0.28s ease, height 0.28s ease;
}

#ob-bd-ring {
  position: fixed;
  border-radius: 12px;
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(80, 200, 255, 0.9), 0 0 24px rgba(80, 200, 255, 0.4);
  animation: ob-ring-pulse 1.5s ease-in-out infinite;
  transition: left 0.28s ease, top 0.28s ease, width 0.28s ease, height 0.28s ease;
}

@keyframes ob-ring-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(80, 200, 255, 0.9),  0 0 24px rgba(80, 200, 255, 0.40); }
  50%      { box-shadow: 0 0 0 3px rgba(61, 255, 160, 0.95), 0 0 34px rgba(61, 255, 160, 0.50); }
}

body.ob-gated #tutorial-cursor { z-index: 10002; }

body.ob-paused #ob-backdrop,
body.ob-paused #ob-tut-popup,
body.ob-paused #tutorial-cursor { display: none !important; }

/* ── BLOCKING MODE — popup (one tiny line + Skip, never "Continue") ── */

#ob-tut-popup {
  position: fixed;
  z-index: 10001;
  max-width: 260px;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  background: rgba(5, 10, 32, 0.97);
  border: 1px solid rgba(80, 200, 255, 0.45);
  border-radius: 12px;
  padding: 12px 16px 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 18px rgba(80, 200, 255, 0.22);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform-origin: center top;
  transition: opacity 0.25s ease;
}

#ob-tut-popup.ob-tp-visible { opacity: 1; }

.ob-tp-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #e8f4ff;
  line-height: 1.4;
  text-align: center;
}

.ob-tp-skip {
  font-family: 'Exo 2', sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(200, 222, 255, 0.4);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 4px;
}

.ob-tp-skip:hover { color: rgba(200, 222, 255, 0.8); }

.ob-tp-btn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 6px;
}

.ob-tp-continue {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #08121f;
  background: linear-gradient(135deg, #ffe6a0, #ffc34d);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 6px 16px;
  box-shadow: 0 0 10px rgba(255, 195, 77, 0.5);
}

.ob-tp-continue:hover { box-shadow: 0 0 16px rgba(255, 195, 77, 0.8); }

/* ── DIM MODE — lightweight one-shot highlight for contextual tutorials ── */

.tut-overlay {
  /* Inert lifecycle/fade tracker — the visible pieces (.tut-hole/.tut-label/
     .tut-arrow/.tut-click-indicator) are positioned independently at the
     document level since they follow the target via getBoundingClientRect. */
  position: fixed;
  inset: 0;
  pointer-events: none;
  animation: tutFadeIn 0.3s ease forwards;
}
@keyframes tutFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes tutFadeOut { from { opacity: 1; } to { opacity: 0; } }
.tut-fadeout { animation: tutFadeOut 0.3s ease forwards !important; }

.tut-hole {
  position: fixed;
  pointer-events: none;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 12, 0.55);
  transition: left 0.2s ease, top 0.2s ease, width 0.2s ease, height 0.2s ease;
  z-index: 10499;
}

.tut-label {
  position: fixed;
  transform: translate(-50%, -100%);
  z-index: 10500;
  background: rgba(4, 0, 20, 0.92);
  border: 1px solid rgba(144, 96, 255, 0.45);
  border-radius: 999px;
  padding: 10px 22px;
  color: #e0d0ff;
  font-family: var(--font-hd, 'Orbitron', sans-serif);
  font-size: 0.78rem;
  letter-spacing: 1px;
  white-space: nowrap;
  box-shadow: 0 0 24px rgba(144, 96, 255, 0.30);
  pointer-events: none;
  transition: left 0.2s ease, top 0.2s ease;
}

.tut-arrow {
  position: fixed;
  z-index: 10500;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid rgba(144, 96, 255, 0.85);
  transform: translate(-50%, 0);
  animation: tutArrowBounce 1s ease-in-out infinite;
  pointer-events: none;
  transition: left 0.2s ease, top 0.2s ease;
}
@keyframes tutArrowBounce {
  0%, 100% { margin-top: 0; }
  50%      { margin-top: 6px; }
}

.tut-click-indicator {
  position: fixed;
  z-index: 10500;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  margin-top: -18px;
  border-radius: 50%;
  border: 2px solid rgba(80, 200, 255, 0.85);
  pointer-events: none;
  animation: tutClickPing 1.1s ease-out infinite;
  transition: left 0.2s ease, top 0.2s ease;
}
@keyframes tutClickPing {
  0%   { transform: scale(0.4); opacity: 0.9; }
  70%  { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(1.15); opacity: 0; }
}
