/* /sounds Slap preview. The stage is fixed, so showing it does not move the page. */

.sound-play {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 420px);
  margin: 0.6rem 0;
  padding: 8px 16px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-align: left;
  border: 3px solid var(--outline);
  box-shadow: var(--edge-glow), var(--shadow);
  cursor: pointer;
}
.sound-play:hover { transform: translate(-1px, -1px); box-shadow: var(--edge-glow), 5px 5px 0 rgba(0, 0, 0, 0.28); }
.sound-play:active { transform: translate(2px, 2px); box-shadow: var(--edge-glow), 1px 1px 0 rgba(0, 0, 0, 0.28); }
.sound-play:focus-visible { outline: 3px solid var(--vine); outline-offset: 3px; }
/* The sound card sizes every audio element like the visible players. This one has no controls. */
figure.sound audio[data-slap-audio] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.sound-play-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--note);
  border: 3px solid var(--outline);
  flex: none;
}
.sound-play-icon::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent var(--outline);
  margin-left: 2px;
}

.slap-demo {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}
.slap-demo[hidden] { display: none !important; }
.slap-demo.leaving { opacity: 0; transition: opacity 0.35s linear; }
.slap-demo canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.demo-note {
  position: absolute;
  z-index: 0;
  width: min(280px, calc(100vw - 24px));
  margin: 0;
  padding: 18px 16px 14px;
  background: var(--note);
  color: #2a1708;
  border: 4px solid var(--outline);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.28);
  transform-origin: 50% 50%;
  rotate: -2deg;
  pointer-events: none;
  user-select: none;
}
.demo-note p { margin: 0; font-weight: 800; line-height: 1.35; }
.demo-tag {
  position: absolute;
  top: -11px;
  right: 12px;
  background: #fff;
  color: #2a1708;
  border: 3px solid var(--outline);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1.4;
  padding: 0 6px;
  rotate: 6deg;
}
.demo-note.slap-in { animation: slap-in 0.3s linear both; }
.demo-note.fall { animation: fall 0.28s ease-in both; }

@media (prefers-reduced-motion: reduce) {
  .slap-demo { display: none !important; }
}
