/* FTUE coach marks and the vibe quiz. Shared by the lobby and the game board —
   both pages mount the same components from static/js/tutorial.js, so there is
   one place to change how onboarding looks.

   The spotlight is one element sized to the target's bounding rect with a
   viewport-swallowing box-shadow: everything outside the rect dims, the rect
   itself stays untouched. It paints only — the click blocking is done by the
   four .tut-block rects around the hole, so an "interactive" step can leave the
   highlighted control usable while the rest of the page is inert. */

.tut-layer {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  font-family: monospace;
}

.tut-block {
  position: fixed;
  pointer-events: auto;
}

.tut-spot {
  position: fixed;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(4, 8, 6, 0.76);
  outline: 2px solid var(--toxic-flash, #AAFF2E);
  outline-offset: 2px;
  pointer-events: none;
  transition: left 180ms ease, top 180ms ease, width 180ms ease, height 180ms ease;
}

/* No target resolved (or a step that deliberately has none): dim everything and
   centre the popup, rather than pointing at nothing. */
.tut-spot.tut-spot-none {
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  outline: none;
  transition: none;
}

@keyframes tut-halo {
  0%, 100% { outline-color: var(--toxic-flash, #AAFF2E); }
  50%      { outline-color: var(--splice-green, #52E87A); }
}
.tut-spot:not(.tut-spot-none) { animation: tut-halo 1.6s ease-in-out infinite; }

.tut-pop {
  position: fixed;
  width: min(340px, calc(100vw - 24px));
  background: var(--deep-canopy, #101A14);
  border: 1px solid var(--cold-steel, #5A7870);
  border-left: 3px solid var(--toxic-flash, #AAFF2E);
  border-radius: 6px;
  padding: 0.85rem 0.95rem;
  pointer-events: auto;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.6);
}

.tut-pop-title {
  color: var(--toxic-flash, #AAFF2E);
  font-size: 0.82rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.tut-pop-body {
  color: var(--bone-moss, #C0B490);
  font-size: 0.85rem;
  line-height: 1.5;
}

.tut-pop-body + .tut-pop-body { margin-top: 0.5rem; }

.tut-pop-foot {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
}

.tut-progress {
  color: var(--cold-steel, #5A7870);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* The lobby styles bare `button` as a full-width form control (and the board
   doesn't), so the same popup renders differently on the two pages: there, the
   footer's buttons stretch to eat the whole row and squeeze the counter down to
   one character per line. This footer is a tight row of small controls on both
   pages — opt back out of the host page's form styling. */
.tut-pop-foot button { width: auto; margin-top: 0; }

.tut-pop-foot .tut-spacer { flex: 1; }

.tut-btn {
  background: var(--plating, #243230);
  color: var(--splice-green, #52E87A);
  border: 1px solid var(--cold-steel, #5A7870);
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: bold;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}
.tut-btn:hover { background: var(--cold-steel, #5A7870); color: var(--void-green, #080C0A); }

.tut-skip {
  background: none;
  border: none;
  color: var(--cold-steel, #5A7870);
  font-family: monospace;
  font-size: 0.72rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.tut-skip:hover { color: var(--mutagen, #FF2E8A); }

/* An interactive step waits on the player doing the highlighted thing, so it
   has no "Got it" button — this line says what to do instead. */
.tut-await {
  color: var(--splice-green, #52E87A);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

/* ── The vibe quiz + the milestone panels ─────────────────────────────────── */

.tut-modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(4, 8, 6, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  font-family: monospace;
  overflow-y: auto;
}

.tut-modal {
  width: min(560px, 100%);
  background: var(--deep-canopy, #101A14);
  border: 1px solid var(--plating, #243230);
  border-radius: 8px;
  padding: 1.4rem;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7);
}

.tut-modal h2 {
  color: var(--splice-green, #52E87A);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.tut-modal .tut-lede {
  color: var(--cold-steel, #5A7870);
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 1.1rem;
}

.tut-q {
  color: var(--bone-moss, #C0B490);
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 0.9rem;
}

.tut-opts { display: flex; flex-direction: column; gap: 0.5rem; }

.tut-opt {
  text-align: left;
  background: var(--undergrowth, #182818);
  color: var(--bone-moss, #C0B490);
  border: 1px solid var(--plating, #243230);
  border-radius: 5px;
  font-family: monospace;
  font-size: 0.85rem;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, transform 120ms ease;
}
.tut-opt:hover {
  border-color: var(--toxic-flash, #AAFF2E);
  color: var(--toxic-flash, #AAFF2E);
  transform: translateX(3px);
}
.tut-opt.selected { border-color: var(--splice-green, #52E87A); color: var(--splice-green, #52E87A); }

.tut-dots { display: flex; gap: 0.35rem; margin-bottom: 1rem; }
.tut-dot {
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--plating, #243230);
}
.tut-dot.done { background: var(--splice-green, #52E87A); }
.tut-dot.current { background: var(--toxic-flash, #AAFF2E); }

.tut-modal-foot {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.2rem;
}
.tut-modal-foot .tut-spacer { flex: 1; }

.tut-result-affs {
  display: flex;
  gap: 0.9rem;
  justify-content: center;
  margin: 1.1rem 0;
  flex-wrap: wrap;
}
.tut-aff {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  min-width: 96px;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--aff-color, var(--cold-steel, #5A7870));
  border-radius: 6px;
  background: var(--undergrowth, #182818);
}
.tut-aff .tut-aff-icon {
  font-family: 'Noto Emoji', monospace;
  font-size: 1.5rem;
  color: var(--aff-color, #C0B490);
  line-height: 1;
}
.tut-aff .tut-aff-name {
  color: var(--aff-color, #C0B490);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tut-reward {
  text-align: center;
  color: var(--cur-spores, #9FB37A);
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  margin: 1rem 0 0.4rem;
}

.tut-error {
  color: var(--mutagen, #FF2E8A);
  font-size: 0.8rem;
  margin-top: 0.7rem;
}

/* A quiet strip in the lobby for a tutorial left half-finished — the way back
   into an abandoned match, or into the step that was next. */
.tut-resume {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  border: 1px solid var(--amber-spore, #7A5C30);
  border-radius: 5px;
  background: rgba(122, 92, 48, 0.12);
  padding: 0.6rem 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--bone-moss, #C0B490);
}
.tut-resume .tut-spacer { flex: 1; }

@media (max-width: 640px) {
  .tut-modal { padding: 1.1rem; }
  .tut-pop { width: min(340px, calc(100vw - 20px)); }
}
