/* Any Piece, Any Colour, PR-1: the owner base and turn emphasis (piece-bases.js). Everything here is keyed
 * on #board-svg[data-piece-bases="on"], which piece-grounding.js writes only while the `pieceBases` flag is
 * on: with the flag off this file matches nothing.
 *
 * MM-16 holds: no effect is laid over the figure or its strip image. The turn lift moves the WHOLE piece
 * element (.token-body: still, strip overlay and all) as one static offset; the glow is on the base, which
 * is a sibling of the figure, never inside it. */

/* 1. The base follows its token like the ground shadow did. Static: with the layer on for everyone, nothing in it
 * animates or transitions (a resting piece stays pixel-still: MM-14, MM-16, PR #264). */
#board-svg[data-piece-bases="on"] #token-layer .game-token > .ludo-piece-base {
  pointer-events: none;
}

/* 2. Turn emphasis. The pieces of the player whose turn it is lift a little and their bases glow; every
 * other piece dims slightly (darker, never see-through; its base a little fainter). The HUD writes the turn's colour on
 * #screen-game[data-active-team]. */
#screen-game[data-active-team="red"] #board-svg[data-piece-bases="on"] #token-layer .game-token:not([data-team="Red"]) > .token-body,
#screen-game[data-active-team="blue"] #board-svg[data-piece-bases="on"] #token-layer .game-token:not([data-team="Blue"]) > .token-body,
#screen-game[data-active-team="yellow"] #board-svg[data-piece-bases="on"] #token-layer .game-token:not([data-team="Yellow"]) > .token-body,
#screen-game[data-active-team="green"] #board-svg[data-piece-bases="on"] #token-layer .game-token:not([data-team="Green"]) > .token-body {
  /* Dimmed, not see-through: the soft ground filter piece-grounding.css gives a resting piece, darkened. */
  filter: url(#ludo-ground-soft) brightness(.8) saturate(.85);
}
#screen-game[data-active-team="red"] #board-svg[data-piece-bases="on"] #token-layer .game-token:not([data-team="Red"]) > .ludo-piece-base,
#screen-game[data-active-team="blue"] #board-svg[data-piece-bases="on"] #token-layer .game-token:not([data-team="Blue"]) > .ludo-piece-base,
#screen-game[data-active-team="yellow"] #board-svg[data-piece-bases="on"] #token-layer .game-token:not([data-team="Yellow"]) > .ludo-piece-base,
#screen-game[data-active-team="green"] #board-svg[data-piece-bases="on"] #token-layer .game-token:not([data-team="Green"]) > .ludo-piece-base {
  opacity: .82;
}
#screen-game[data-active-team="red"] #board-svg[data-piece-bases="on"] #token-layer .game-token[data-team="Red"] > .token-body,
#screen-game[data-active-team="blue"] #board-svg[data-piece-bases="on"] #token-layer .game-token[data-team="Blue"] > .token-body,
#screen-game[data-active-team="yellow"] #board-svg[data-piece-bases="on"] #token-layer .game-token[data-team="Yellow"] > .token-body,
#screen-game[data-active-team="green"] #board-svg[data-piece-bases="on"] #token-layer .game-token[data-team="Green"] > .token-body {
  translate: 0 -2.5px;
}
#screen-game[data-active-team="red"] #board-svg[data-piece-bases="on"] #token-layer .game-token[data-team="Red"] > .ludo-piece-base .ludo-piece-base-disc,
#screen-game[data-active-team="blue"] #board-svg[data-piece-bases="on"] #token-layer .game-token[data-team="Blue"] > .ludo-piece-base .ludo-piece-base-disc,
#screen-game[data-active-team="yellow"] #board-svg[data-piece-bases="on"] #token-layer .game-token[data-team="Yellow"] > .ludo-piece-base .ludo-piece-base-disc,
#screen-game[data-active-team="green"] #board-svg[data-piece-bases="on"] #token-layer .game-token[data-team="Green"] > .ludo-piece-base .ludo-piece-base-disc {
  filter: brightness(1.18) drop-shadow(0 0 2px #fff);   /* a steady glow: no pulse, no animation (MM-14 / MM-16 stillness) */
}

/* 3. Reduced Motion (the OS setting, or the game's Calm toggle): no lift and no pulse. The base still
 * brightens and the other pieces still dim. */
@media (prefers-reduced-motion: reduce) {
  #board-svg[data-piece-bases="on"] #token-layer .game-token > .token-body { translate: none !important; transition: none !important; }
  #board-svg[data-piece-bases="on"] #token-layer .game-token > .ludo-piece-base .ludo-piece-base-disc { animation: none !important; }
}
body.calm #board-svg[data-piece-bases="on"] #token-layer .game-token > .token-body {
  translate: none !important;
  transition: none !important;
}
body.calm #board-svg[data-piece-bases="on"] #token-layer .game-token > .ludo-piece-base .ludo-piece-base-disc {
  animation: none !important;
}

/* 4. Performance mode: a static base. No glow and no animation; the turn's bases only brighten. */
body.performance-mode #board-svg[data-piece-bases="on"] #token-layer .game-token > .ludo-piece-base .ludo-piece-base-disc {
  animation: none !important;
  transition: none !important;
  filter: none !important;
}
body.performance-mode #screen-game[data-active-team="red"] #board-svg[data-piece-bases="on"] #token-layer .game-token[data-team="Red"] > .ludo-piece-base .ludo-piece-base-disc,
body.performance-mode #screen-game[data-active-team="blue"] #board-svg[data-piece-bases="on"] #token-layer .game-token[data-team="Blue"] > .ludo-piece-base .ludo-piece-base-disc,
body.performance-mode #screen-game[data-active-team="yellow"] #board-svg[data-piece-bases="on"] #token-layer .game-token[data-team="Yellow"] > .ludo-piece-base .ludo-piece-base-disc,
body.performance-mode #screen-game[data-active-team="green"] #board-svg[data-piece-bases="on"] #token-layer .game-token[data-team="Green"] > .ludo-piece-base .ludo-piece-base-disc {
  filter: brightness(1.18) !important;
}

/* 5. The movable-piece ring (piece-grounding.css restyles it as a team-colour ground ellipse) stays: it is
 * drawn after the base, so it sits on top of it. Nothing to change here. */
