/* snake (public/arcade/snake.js). Arcade tokens come from arcade.css. */
.ag-stage[data-kind="snake"] { touch-action: none; }
.ag-stage[data-kind="snake"] .sn-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ag-stage[data-kind="snake"] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* The arrow pad (member request): four big keys in a diamond over the middle of the board. Ghostly so the
   snakes stay visible underneath; a pressed key lights up like a cabinet button. Only the keys take touches,
   so swipes still work everywhere else. --sn-k (one key's size) and top are set from the board in snake.js. */
.ag-stage[data-kind="snake"] .sn-pad { --sn-k: 96px; position: absolute; left: 50%; top: 50%; z-index: 5;
  transform: translate(-50%, -50%); display: grid; gap: calc(var(--sn-k) * .06);
  grid-template: repeat(3, var(--sn-k)) / repeat(3, var(--sn-k));
  grid-template-areas: ". u ." "l . r" ". d ."; pointer-events: none; }
.ag-stage[data-kind="snake"] .sn-pad[hidden] { display: none; }
.ag-stage[data-kind="snake"] .sn-key { pointer-events: auto; display: grid; place-items: center; padding: 0; margin: 0;
  border: 3px solid rgba(124, 140, 255, .55); border-radius: calc(var(--sn-k) * .22); background: rgba(34, 43, 115, .22);
  color: rgba(238, 240, 250, .7); cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.ag-stage[data-kind="snake"] .sn-key[data-dir="u"] { grid-area: u; }
.ag-stage[data-kind="snake"] .sn-key[data-dir="l"] { grid-area: l; }
.ag-stage[data-kind="snake"] .sn-key[data-dir="r"] { grid-area: r; }
.ag-stage[data-kind="snake"] .sn-key[data-dir="d"] { grid-area: d; }
.ag-stage[data-kind="snake"] .sn-key svg { width: 52%; height: 52%; fill: currentColor; }
.ag-stage[data-kind="snake"] .sn-key[data-dir="r"] svg { transform: rotate(90deg); }
.ag-stage[data-kind="snake"] .sn-key[data-dir="d"] svg { transform: rotate(180deg); }
.ag-stage[data-kind="snake"] .sn-key[data-dir="l"] svg { transform: rotate(-90deg); }
.ag-stage[data-kind="snake"] .sn-key.hit { animation: sn-hit .28s ease-out; }
@keyframes sn-hit {
  0% { background: rgba(238, 240, 250, .55); border-color: #eef0fa; color: #000; }
  100% { background: rgba(34, 43, 115, .22); border-color: rgba(124, 140, 255, .55); color: rgba(238, 240, 250, .7); }
}
@media (prefers-reduced-motion: reduce) { .ag-stage[data-kind="snake"] .sn-key.hit { animation-duration: .01s; } }
