/*
 * Vic's just-in-time hints (owner 5.10.2026; approved for release 6.10.2026).
 * lib/motor-vic-hints.js owns the one fixed layer and moves its parts with
 * transforms; nothing here changes the layout of the game underneath.
 *
 * The layer never takes a click (pointer-events: none) except the bubble's
 * small close button. It sits under every modal overlay (Fleet Tender 10002,
 * the tutorial 10050) and the script hides it while any of them is open.
 */
.motor-vic {
  position: fixed;
  inset: 0;
  z-index: 9400;
  pointer-events: none;
  contain: layout style;
}
.motor-vic[hidden] { display: none; }

.motor-vic__img,
.motor-vic__bubble,
.motor-vic__arrow,
.motor-vic__ring {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.motor-vic__img {
  width: 81px;
  height: 140px;
  user-select: none;
  filter: drop-shadow(0 4px 6px rgba(9, 30, 40, 0.28));
}

/* The tutorial's own bubble: dark, teal edge, white text. Short line, two
   lines at most. */
.motor-vic__bubble {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  box-sizing: border-box;
  max-width: 230px;
  padding: 9px 8px 9px 13px;
  border: 2px solid #2cc4b5;
  border-radius: 14px;
  background: #0d2b38;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  box-shadow: 0 8px 22px rgba(9, 30, 40, 0.3);
}
.motor-vic__text { flex: 1 1 auto; }
/* The tail towards Vic's head: left of the bubble when it sits beside him,
   right when he stands mirrored, under it when it sits above him. */
.motor-vic__bubble::before {
  content: '';
  position: absolute;
  top: 14px;
  left: -8px;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: solid #2cc4b5;
  border-width: 0 0 2px 2px;
  background: #0d2b38;
  transform: rotate(45deg);
}
.motor-vic--mirrored .motor-vic__bubble::before { left: auto; right: -8px; transform: rotate(-135deg); }
.motor-vic[data-bubble="above"] .motor-vic__bubble::before {
  top: auto;
  right: auto;
  bottom: -8px;
  left: var(--vic-tail-x, calc(50% - 6px));
  transform: rotate(-45deg);
}
.motor-vic__close {
  pointer-events: auto;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: -2px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: 700 15px/22px system-ui, sans-serif;
  cursor: pointer;
}
.motor-vic__close:hover,
.motor-vic__close:focus-visible { background: rgba(255, 255, 255, 0.28); outline: none; }

/* From Vic's fingertip to the control. */
.motor-vic__arrow {
  height: 4px;
  border-radius: 2px;
  background: #14a397;
}
.motor-vic__arrow::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -6px;
  border: 7px solid transparent;
  border-right: 9px solid #14a397;
  border-left: 0;
}
.motor-vic--mirrored .motor-vic__arrow::before {
  left: auto;
  right: -6px;
  border-right: 0;
  border-left: 9px solid #14a397;
}

/* A ring around the control: transparent inside, so the control itself is
   never covered and stays clickable. */
.motor-vic__ring {
  box-sizing: border-box;
  border: 3px solid #14a397;
  border-radius: 12px;
  box-shadow: 0 0 0 4px rgba(20, 163, 151, 0.18);
}

/* Entrance: a short rise and fade, the ring pulses twice. */
.motor-vic__img,
.motor-vic__bubble,
.motor-vic__arrow,
.motor-vic__ring { opacity: 0; }
.motor-vic--in .motor-vic__img,
.motor-vic--in .motor-vic__bubble,
.motor-vic--in .motor-vic__arrow,
.motor-vic--in .motor-vic__ring {
  opacity: 1;
  transition: opacity 0.2s ease-out;
}
.motor-vic--in .motor-vic__img { animation: motor-vic-rise 0.32s ease-out; }
.motor-vic--in .motor-vic__ring { animation: motor-vic-pulse 1.1s ease-out 0.2s 2; }

@keyframes motor-vic-rise {
  from { translate: 0 10px; }
  60% { translate: 0 -3px; }
  to { translate: 0 0; }
}
@keyframes motor-vic-pulse {
  0% { box-shadow: 0 0 0 0 rgba(20, 163, 151, 0.45); }
  100% { box-shadow: 0 0 0 12px rgba(20, 163, 151, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .motor-vic--in .motor-vic__img,
  .motor-vic--in .motor-vic__ring { animation: none; }
  .motor-vic--in .motor-vic__img,
  .motor-vic--in .motor-vic__bubble,
  .motor-vic--in .motor-vic__arrow,
  .motor-vic--in .motor-vic__ring { transition: none; }
}
