/* ============================================================================
 * game-feel.css — styles for the PlainLogicFeel shared game-feel layer.
 * Companion to assets/js/game-feel.js. Safe to load on any page; everything
 * is inert until the game calls PlainLogicFeel methods.
 * ========================================================================== */

/* Full-viewport particle overlay. pointer-events: none so it can never eat
 * game input; z-index high enough to sit above game art but below toasts. */
canvas.pl-feel-particles {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 60;
}

/* Non-blocking feedback toast. Game pages position it; default is bottom. */
.pl-feel-toast {
  position: fixed;
  left: 50%;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  transform: translate(-50%, 0.75rem);
  max-width: min(92vw, 26rem);
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: #171614;
  color: #f7f3ec;
  font-size: 0.9rem;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 70;
}
.pl-feel-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.pl-feel-toast.good {
  background: #1d5c38;
}
.pl-feel-toast.bad {
  background: #8f2d23;
}

/* Success/failure flash ring on a game element (e.g. the board). Short,
 * single iteration, and purely decorative. */
.pl-feel-flash-good,
.pl-feel-flash-bad {
  animation-duration: 0.45s;
  animation-timing-function: ease-out;
  animation-iteration-count: 1;
}
.pl-feel-flash-good {
  animation-name: pl-feel-flash-good;
}
.pl-feel-flash-bad {
  animation-name: pl-feel-flash-bad;
}
@keyframes pl-feel-flash-good {
  0%   { box-shadow: 0 0 0 0 rgba(46, 160, 90, 0.65); }
  100% { box-shadow: 0 0 0 14px rgba(46, 160, 90, 0); }
}
@keyframes pl-feel-flash-bad {
  0%   { box-shadow: 0 0 0 0 rgba(210, 70, 55, 0.6); }
  100% { box-shadow: 0 0 0 14px rgba(210, 70, 55, 0); }
}

/* Mute toggle button (optional helper class for a game-supplied button). */
.pl-feel-mute {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
  touch-action: manipulation;
}
.pl-feel-mute[aria-pressed="true"] {
  opacity: 0.55;
}

/* Reduced motion: kill the flash animation and toast transition so state
 * changes read as instant. */
@media (prefers-reduced-motion: reduce) {
  .pl-feel-flash-good,
  .pl-feel-flash-bad {
    animation: none;
  }
  .pl-feel-toast {
    transition: none;
  }
}
