/* Board guidance for backgammon-game.js: which checkers can move, where they can go, what the
   opponent just did, pip dice, and the turn controls. Loaded after backgammon-game.min.css. */

/* ── Your movable checkers (before you pick one) ── */
.checker.can-move {
  box-shadow: 0 0 0 3px #ffd54f, 0 0 12px 2px rgba(255, 213, 79, .7);
  animation: bgCanMove 1.6s ease-in-out infinite;
  z-index: 2;
}
@keyframes bgCanMove {
  0%, 100% { box-shadow: 0 0 0 3px #ffd54f, 0 0 12px 2px rgba(255, 213, 79, .55); }
  50%      { box-shadow: 0 0 0 3px #ffe082, 0 0 18px 5px rgba(255, 213, 79, .9); }
}
.bar-checker.can-move { box-shadow: 0 0 0 3px #ffd54f, 0 0 10px 2px rgba(255, 213, 79, .7); }

/* ── The checker you picked ── */
.checker.picked {
  transform: scale(1.18);
  box-shadow: 0 0 0 3px #fff, 0 0 16px 4px rgba(255, 255, 255, .75);
  z-index: 3;
}
.point-col.selected { background: rgba(255, 213, 79, .12); }

/* ── Where it can go: a ring where the checker would land, with the die it uses ── */
.dest-marker {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; position: relative; z-index: 2;
  border: 3px dashed #69f0ae; background: rgba(105, 240, 174, .22);
  display: flex; align-items: center; justify-content: center;
  color: #e8fff2; font-weight: 800; font-size: .72em;
  animation: bgDest 1s ease-in-out infinite alternate;
}
@keyframes bgDest { from { transform: scale(.92); } to { transform: scale(1.06); } }
.point-col.highlight { background: rgba(105, 240, 174, .14); }
.point-col.highlight::after { border-color: rgba(105, 240, 174, .8); }
.point-col.top .dest-marker.stacked { margin-top: -6px; }
.point-col.bottom .dest-marker.stacked { margin-bottom: -6px; }
.bearoff-tray.highlight {
  border: 2px dashed #69f0ae; background: rgba(105, 240, 174, .18);
  animation: bgDest 1s ease-in-out infinite alternate;
}

/* ── What the opponent just did ── */
.point-col.last-from::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(100, 181, 246, .14) 0 6px, transparent 6px 12px);
  border: 1px solid rgba(100, 181, 246, .5);
}
.checker.last-to { box-shadow: 0 0 0 3px #64b5f6, 0 0 10px 2px rgba(100, 181, 246, .7); }
.checker.just-moved { animation: bgArrive .45s ease-out; }
@keyframes bgArrive {
  0%   { transform: scale(1.6); opacity: .2; }
  70%  { transform: scale(.94); opacity: 1; }
  100% { transform: scale(1); }
}
.bar-checker.just-hit { animation: bgHit .6s ease-in-out 2; box-shadow: 0 0 0 3px #ef5350; }
@keyframes bgHit {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* ── Your home board: label and direction of travel ── */
.quadrant { position: relative; }
.home-label {
  position: absolute; left: 0; right: 0; text-align: center; pointer-events: none; z-index: 0;
  color: rgba(255, 213, 79, .55); font-size: .62em; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.home-label.at-top { bottom: 16px; }
.home-label.at-bottom { top: 16px; }
.quadrant.my-home { box-shadow: inset 0 0 0 2px rgba(255, 213, 79, .28); }

/* ── Dice with pips ── */
#dice-display { gap: 8px; align-items: center; }
.die {
  width: 48px; height: 48px; padding: 6px; box-sizing: border-box; font-size: 0;
  display: grid !important; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
}
.die[hidden] { display: none !important; }
.die .pip { width: 8px; height: 8px; border-radius: 50%; background: #222; align-self: center; justify-self: center; }
.die.theirs { background: #4e342e; box-shadow: 0 2px 6px rgba(0, 0, 0, .4), inset 0 0 0 2px #8d6e63; }
.die.theirs .pip { background: #f3e0c7; }
.die.used { opacity: .28; text-decoration: none; transform: scale(.9); }
#dice-remaining { min-width: 5.5em; }

/* ── Status line, above the board (a bottom anchor ad covered it below the board). A fixed
   minimum height keeps the board from jumping as the text changes between one and two lines. ── */
#game-status {
  margin: 0 0 10px; min-height: 64px; box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: center;
}

/* ── Turn controls ── */
.roll-btn.ready { animation: bgReady 1.2s ease-in-out infinite; }
@keyframes bgReady {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 213, 79, .0); transform: scale(1); }
  50%      { box-shadow: 0 0 0 6px rgba(255, 213, 79, .35); transform: scale(1.04); }
}
#confirm-btn.counting { background: #2e7d32 !important; }
#bg-options {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  color: #aaa; font-size: .85em; margin: 2px 0 8px;
}
#bg-options label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 32px; }
#bg-options input { width: 18px; height: 18px; accent-color: #d4a76a; }

@media (max-width: 600px) {
  .die { width: 40px; height: 40px; padding: 5px; }
  .die .pip { width: 7px; height: 7px; }
  .dest-marker { width: 24px; height: 24px; font-size: .62em; border-width: 2px; }
}
@media (max-width: 400px) {
  .die { width: 34px; height: 34px; padding: 4px; }
  .die .pip { width: 6px; height: 6px; }
  .dest-marker { width: 20px; height: 20px; font-size: .55em; }
  .home-label { font-size: .5em; }
}
@media (prefers-reduced-motion: reduce) {
  .checker.can-move, .dest-marker, .bearoff-tray.highlight, .roll-btn.ready,
  .checker.just-moved, .bar-checker.just-hit { animation: none; }
}
