/* The same board guidance for directed lessons and explicitly revealed hints. */
.move-guide-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.supplement-board { position: relative; }

.move-guide-arrow {
  fill: #8fc6dc;
  stroke: #355c69;
  stroke-width: .22;
  stroke-linejoin: round;
}

[data-move-guide-active]:has([data-move-guide="from"]:is(.selected, .is-selected)) > .move-guide-layer {
  opacity: .62;
}

#board[data-move-guide-active] > .board-arrows {
  visibility: hidden;
}

:is(#board, #rush-board, .supplement-board) :is(.square, .rush-cell, .supplement-square)[data-move-guide]:not(.danger, .in-check, .mistake, .is-wrong, .is-manual)::before {
  content: "";
  position: absolute;
  inset: 5.6%;
  z-index: 0;
  border: 0;
  border-radius: 4%;
  outline: 0;
  pointer-events: none;
}

:is(#board, #rush-board, .supplement-board) :is(.square, .rush-cell, .supplement-square)[data-move-guide="from"]:not(.danger, .in-check, .mistake, .is-wrong, .is-manual)::before {
  background: rgb(120 180 204 / 16%);
}

#board .square[data-move-guide="from"].selected:not(.danger, .in-check, .mistake)::before {
  background: #ffff337d;
}

:is(#board, #rush-board, .supplement-board) :is(.square, .rush-cell, .supplement-square)[data-move-guide="to"]:not(.danger, .in-check, .mistake, .is-wrong, .is-manual)::before {
  border: clamp(1px, .36vw, 3px) solid #9ed3e8;
  background: rgb(185 225 232 / 22%);
}

[data-move-guide="from"] > :is(.piece, .rush-piece, img) {
  filter: drop-shadow(1px 0 #78b4cc) drop-shadow(-1px 0 #78b4cc)
    drop-shadow(0 1px #78b4cc) drop-shadow(0 -1px #78b4cc);
}

@keyframes move-guide-draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes move-guide-pulse {
  0%, 100% { background-color: rgb(185 225 232 / 12%); }
  50% { background-color: rgb(185 225 232 / 31%); }
}

@media (prefers-reduced-motion: no-preference) {
  .move-guide-reveal {
    transform-box: fill-box;
    transform-origin: left center;
    animation: move-guide-draw 380ms ease-out both;
  }

  :is(#board, #rush-board, .supplement-board) :is(.square, .rush-cell, .supplement-square)[data-move-guide="to"]:not(.danger, .in-check, .mistake, .is-wrong, .is-manual)::before {
    animation: move-guide-pulse 2.8s ease-in-out infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  .move-guide-layer { transition: none; }
}
