/* Clean-base grounding (Vault board 1178): the strips no longer carry a baked disc, so the renderer
 * grounds every sprite piece. piece-grounding.js marks sprite tokens data-ludo-ground="on" and draws
 * the tile-sized .ludo-ground-shadow ellipse; these rules do the rest. Native boards only: custom
 * renderers keep their own contracts. Nothing here moves a figure (MM-16): the only pulse is on the
 * selection ring, which is a sibling of the figure, never inside it. */

/* 1. Ground shadow: a soft, flat ellipse at the figure's feet. It follows the token like the ring. */
#board-svg #token-layer .game-token > .ludo-ground-shadow {
  pointer-events: none;
  transition: cx 300ms ease-out, cy 300ms ease-out, opacity 300ms ease-out;
}
#board-svg.board-has-selection #token-layer .game-token:not(.selectable) > .ludo-ground-shadow {
  opacity: .62;
}

/* 2. Selection ring -> team-colour ground ellipse under the movable piece, pulse kept. app.js still
 * decides which pieces get a .sel-ring (movable ones only); this only restyles it. The circle is
 * flattened about its own centre, so it lies on the ground under the feet. */
#board-svg #token-layer .game-token.selectable[data-ludo-ground="on"] > .sel-ring {
  --ludo-ground-team: #ffffff;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transform: scaleY(.36);
  vector-effect: non-scaling-stroke;
  fill: var(--ludo-ground-team) !important;
  fill-opacity: .30;
  stroke: var(--ludo-ground-team) !important;
  stroke-width: 1.6 !important;
  stroke-dasharray: none !important;
  stroke-opacity: .95;
  opacity: 1 !important;
  filter: drop-shadow(0 0 1.6px var(--ludo-ground-team)) !important;
  animation: ludo-ground-ring-pulse 1.6s ease-in-out infinite !important;
}
#board-svg #token-layer .game-token.selectable[data-ludo-ground="on"][data-team="Red"] > .sel-ring { --ludo-ground-team: #E53935; }
#board-svg #token-layer .game-token.selectable[data-ludo-ground="on"][data-team="Blue"] > .sel-ring { --ludo-ground-team: #1E88E5; }
#board-svg #token-layer .game-token.selectable[data-ludo-ground="on"][data-team="Yellow"] > .sel-ring { --ludo-ground-team: #FBC02D; }
#board-svg #token-layer .game-token.selectable[data-ludo-ground="on"][data-team="Green"] > .sel-ring { --ludo-ground-team: #2E7D32; }
#board-svg #token-layer .game-token.selectable[data-ludo-ground="on"]:focus-visible > .sel-ring {
  stroke-width: 2.4 !important;
  fill-opacity: .42;
}
@keyframes ludo-ground-ring-pulse {
  0%, 100% { fill-opacity: .34; stroke-opacity: .95; }
  50% { fill-opacity: .14; stroke-opacity: .45; }
}
@media (prefers-reduced-motion: reduce) {
  #board-svg #token-layer .game-token.selectable[data-ludo-ground="on"] > .sel-ring { animation: none !important; }
}
body.calm #board-svg #token-layer .game-token.selectable[data-ludo-ground="on"] > .sel-ring,
body.performance-mode #board-svg #token-layer .game-token.selectable[data-ludo-ground="on"] > .sel-ring {
  animation: none !important;
}
body.performance-mode #board-svg #token-layer .game-token.selectable[data-ludo-ground="on"] > .sel-ring {
  filter: none !important;
}

/* 3. #warrior-shadow (app.js: dy 2, blur 2, 0.28) doubled the ground ellipse into a black puddle
 * under the feet. Resting sprite pieces use the softer #ludo-ground-soft instead. Selectable pieces
 * keep #warrior-lift: the lift is the point. Walking stand-ins (clones of the body) follow suit. */
#board-svg #token-layer .game-token[data-ludo-ground="on"]:not(.selectable) > .token-body {
  filter: url(#ludo-ground-soft);
}
#board-svg #movement-presentation-layer .m2-movement-clone[filter="url(#warrior-shadow)"]:has(.warrior-sprite) {
  filter: url(#ludo-ground-soft);
}

/* 4. Board play draws no pedestals: pedestal skins are Locker products, and the Locker stage keeps the
 * equipped pedestal under the figure (locker-stage.js). The board's vector pedestal layers are left in
 * the DOM (other probes read them) but not drawn under a sprite piece or its walking stand-in. */
#board-svg #token-layer .game-token[data-ludo-ground="on"] .token-pedestal,
#board-svg #token-layer .game-token[data-ludo-ground="on"] .locker-pedestal,
#board-svg #movement-presentation-layer .m2-movement-clone:has(.warrior-sprite) .token-pedestal,
#board-svg #movement-presentation-layer .m2-movement-clone:has(.warrior-sprite) .locker-pedestal {
  display: none !important;
}

/* 5. Where the feet stand is part of the one size rule (figure-size.js RULE.foot: .42 of the cell below
 * the cell centre, 15.96 board units on the track and 25.368 in the yard). The figure is placed there by
 * its own fit transform; the CSS content drop that stood here (10 px) is deleted (P1). The team ring on a
 * movable piece follows the feet; the token's position and its tap target (.hit-area) stay put. */
#board-svg #token-layer .game-token.selectable[data-ludo-ground="on"]:not(.token-in-base) > .sel-ring {
  translate: 0 15.96px;
}
#board-svg #token-layer .game-token.selectable[data-ludo-ground="on"].token-in-base > .sel-ring {
  translate: 0 25.368px;
}
#board-svg #token-layer .game-token.selectable.token-shared-cell[data-ludo-ground="on"]:not(.token-in-base) > .sel-ring {
  translate: 0 9.9px;
}

/* The walking stand-in's own shadow (movement-presentation-service.js): tile-sized, never scaled. */
#board-svg #movement-presentation-layer > .ludo-ground-shadow { pointer-events: none; }

/* 6. Depth on the board (Clement 2026-12-02: the pieces look flat; make them look 3D where they stand).
 * ONE light for the whole board, top-left. The ground ellipse above is the contact patch and throws the
 * cast shadow down-right (piece-grounding.js #ludo-ground-depth). Here the figure itself carries the light:
 * #ludo-top-light-* lays a gradient atop the figure's own pixels, lighter at the top-left, falling off
 * downward. Static: no animation, no transition, no idle (MM-16; PR #264 stillness). The same filter for
 * every set. A yard body is drawn 2.2x, so it has its own copy in its own units. Walking, capturing and
 * home stand-ins (clones of the body) keep the light they had at rest. */
#board-svg #token-layer .game-token[data-ludo-depth="on"] > .token-body > .warrior-figure,
#board-svg #movement-presentation-layer .m2-movement-clone .warrior-figure:has(.warrior-sprite),
#board-svg #capture-presentation-layer .warrior-figure:has(.warrior-sprite),
#board-svg #home-presentation-layer .warrior-figure:has(.warrior-sprite) {
  filter: url(#ludo-top-light-track);
}
#board-svg #token-layer .game-token.token-in-base[data-ludo-depth="on"] > .token-body > .warrior-figure {
  filter: url(#ludo-top-light-yard);
}
/* Two skins already glow on the board (locker.css): the light goes first, the glow after it. */
body[data-piece-skin="holo-squad"] #board-svg #token-layer .game-token[data-ludo-depth="on"] > .token-body > .warrior-figure {
  filter: url(#ludo-top-light-track) drop-shadow(0 0 3px rgba(98,232,255,.55));
}
body[data-piece-skin="holo-squad"] #board-svg #token-layer .game-token.token-in-base[data-ludo-depth="on"] > .token-body > .warrior-figure {
  filter: url(#ludo-top-light-yard) drop-shadow(0 0 3px rgba(98,232,255,.55));
}
body[data-piece-skin="shadow-ops"] #board-svg #token-layer .game-token[data-ludo-depth="on"] > .token-body > .warrior-figure {
  filter: url(#ludo-top-light-track) drop-shadow(0 0 3px rgba(181,99,255,.45));
}
body[data-piece-skin="shadow-ops"] #board-svg #token-layer .game-token.token-in-base[data-ludo-depth="on"] > .token-body > .warrior-figure {
  filter: url(#ludo-top-light-yard) drop-shadow(0 0 3px rgba(181,99,255,.45));
}
