/* ─── Click FX: Event-Marker Micro-Interactions ─── */
/* Brand = conditioned reinforcement + event marking (Karen Pryor clicker principle) */

:root {
  --click-sound-enabled: 1; /* 1 = on, 0 = off (JS toggles) */
  --click-ring-color: var(--brand);
  --click-ring-duration: 180ms;
}

/* Visual mark on hover/focus - the "event marker" */
.bc-cta,
.btn-primary {
  position: relative;
  overflow: visible;
}

.bc-cta::before,
.btn-primary::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 2px solid var(--click-ring-color);
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
  transition: opacity var(--click-ring-duration) ease-out,
              transform var(--click-ring-duration) ease-out;
  z-index: -1;
}

/* Hover: ring expands (visual mark - like a clicker flash) */
.bc-cta:hover::before,
.btn-primary:hover::before,
.bc-cta:focus-visible::before,
.btn-primary:focus-visible::before {
  opacity: 0.6;
  transform: scale(1.05);
}

/* Press: ring snaps to center (the "click" moment) */
.bc-cta:active::before,
.btn-primary:active::before {
  opacity: 1;
  transform: scale(1);
  transition-duration: 60ms;
}

/* Sound toggle button (placed next to cave-mode toggle) */
.click-sound-toggle {
  position: fixed;
  left: 16px;
  bottom: 56px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  font: 600 12px/1 var(--font-ui);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), opacity 0.2s;
  opacity: 0.5;
}
.click-sound-toggle:hover,
.click-sound-toggle:focus-visible {
  opacity: 1;
  transform: scale(1.06);
}
.click-sound-toggle .click-ic { font-size: 14px; line-height: 1; }
.click-sound-toggle[aria-pressed="false"] .click-on,
.click-sound-toggle[aria-pressed="true"] .click-off {
  display: none;
}

/* Reduced motion: disable all animations */
@media (prefers-reduced-motion: reduce) {
  .bc-cta::before,
  .btn-primary::before {
    display: none !important;
  }
  .bc-cta,
  .btn-primary {
    animation: none !important;
    transition: none !important;
  }
  .bc-cta:hover,
  .btn-primary:hover {
    transform: none !important;
  }
}
