html, body {
  margin: 0;
  height: 100%;
  background: #000;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1.2s ease;
}
#stage.ready { opacity: 1; }

#stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Entry gate and sound toggle, shared by every card. */
.dyn-gate {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 10;
}
.dyn-gate:focus-visible .dyn-ctl { outline: 1px solid currentColor; outline-offset: 8px; }

.dyn-ctl {
  position: absolute;
  left: 50%;
  bottom: 7vh;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 10px 4px;
  border: 0;
  background: transparent;
  color: var(--dyn-ink, #e8e2d8);
  font: 11px/1 'DM Mono', ui-monospace, monospace;
  letter-spacing: .5em;
  white-space: nowrap;
  z-index: 11;
}
.dyn-ctl[hidden] { display: none; }
.dyn-right .dyn-ctl {
  left: auto;
  right: clamp(16px, 3vw, 40px);
  bottom: clamp(6px, calc(3vw - 10px), 30px);
  transform: none;
}
.dyn-difference .dyn-ctl { mix-blend-mode: difference; }

.dyn-gate .dyn-ctl { animation: dyn-hint 2.2s ease-in-out infinite; }
@keyframes dyn-hint { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

button.dyn-ctl { cursor: pointer; }
.dyn-bars { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.dyn-bars i {
  width: 2px;
  height: 12px;
  background: var(--dyn-bar, currentColor);
  transform-origin: bottom;
  transition: transform .08s linear;
}
.dyn-bars i:nth-child(1) { transform: scaleY(var(--q0, .2)); }
.dyn-bars i:nth-child(2) { transform: scaleY(var(--q1, .2)); }
.dyn-bars i:nth-child(3) { transform: scaleY(var(--q2, .2)); }
.dyn-bars i:nth-child(4) { transform: scaleY(var(--q3, .2)); }
.dyn-muted .dyn-bars i { transform: scaleY(.15); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .dyn-gate .dyn-ctl { animation: none; opacity: .8; }
}
