/* Stage and engine-level effects. Actor art brings its own scoped styles. */
.stage-viewport { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: #8ecdfb;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.stage { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; transform-origin: 0 0; }
.stage svg { display: block; overflow: visible; }
.stage .layer, .stage .actor, .stage .halo, .stage .fx, .stage .overlay { position: absolute; left: 0; top: 0; }
.stage .layer, .stage .fx, .stage .overlay { width: 1280px; height: 720px; pointer-events: none; }
.stage .layer svg { width: 1280px; height: 720px; }
.stage .actor { transform-origin: 0 0; pointer-events: none; }
.stage .actor.tappable { pointer-events: auto; cursor: pointer; }

/* glow behind whatever can be tapped; sits under hiding spots so it never washes out a hint */
.stage .halo { opacity: 0; filter: blur(16px); pointer-events: none; z-index: 10; }
.stage .halo i { position: absolute; display: block; background: #fff; }
.stage .halo.on { animation: engine-halo 1.1s ease-in-out infinite; }
@keyframes engine-halo { 0%, 100% { opacity: .45; } 50% { opacity: .95; } }

.stage .fx { z-index: 95; }
.stage .overlay { z-index: 96; }
.stage .spark { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; opacity: 0;
  animation: engine-spark .95s cubic-bezier(.2, .7, .3, 1) var(--d, 0s) 1 both; }
@keyframes engine-spark {
  0% { opacity: 0; transform: translate(0, 0) scale(.2) rotate(0deg); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.6) rotate(120deg); }
}

/* the pause button from ui-kit.js; a UI places it and may resize it */
.pause-btn { position: absolute; left: 12px; top: 12px; z-index: 4; width: 40px; height: 40px; padding: 8px; border-radius: 50%;
  border: 3px solid #3d2b3f; background: rgba(255, 255, 255, .85); color: #3d2b3f; cursor: pointer; line-height: 0; opacity: .75; transition: opacity .15s; }
.pause-btn:hover { opacity: 1; }
.pause-btn[hidden] { display: none; }
.pause-btn svg { width: 100%; height: 100%; fill: currentColor; display: block; }
.pause-btn.paused { opacity: 1; background: #ffc233; animation: engine-waiting 1.2s ease-in-out infinite; }
@keyframes engine-waiting { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.stage-viewport.paused { filter: saturate(.75) brightness(.97); }

/* shown by the engine when the browser refuses sound until the page is clicked */
.sound-off { position: absolute; left: 0; right: 0; bottom: 14px; margin: 0 auto; width: max-content; z-index: 7; padding: 9px 18px; border-radius: 999px;
  border: 3px solid #3d2b3f; background: #ffc233; color: #3d2b3f; font: 800 17px/1.2 system-ui, sans-serif; cursor: pointer;
  box-shadow: 0 4px 0 #3d2b3f; animation: engine-waiting 1.2s ease-in-out infinite; }
.sound-off[hidden] { display: none; }
.sound-off svg { width: 22px; height: 22px; margin-right: 8px; vertical-align: -5px; fill: currentColor; }
