/* Shared by the gallery and the dev harness. A design never edits this file. */

.dsp-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  container-type: inline-size;
  overflow: hidden;
  border-radius: 8px;
  isolation: isolate;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.dsp-stage *,
.dsp-stage *::before,
.dsp-stage *::after {
  box-sizing: border-box;
}

.dsp-scrubber {
  --dsp-bar: #d97706;
  --dsp-rail: rgba(120, 113, 108, 0.28);
  box-sizing: border-box;
  width: 100%;
  padding: 0 4px;
  font: 500 12px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  color: inherit;
}

.dsp-scrubber-track {
  padding: 12px 0;
  cursor: pointer;
  touch-action: none;
  outline: none;
}

.dsp-scrubber-rail {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--dsp-rail);
}

.dsp-scrubber-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--dsp-bar);
}

.dsp-scrubber-thumb {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--dsp-bar);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  transform: scale(0.75);
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.dsp-scrubber-track:hover .dsp-scrubber-thumb,
.dsp-scrubber-track:active .dsp-scrubber-thumb,
.dsp-scrubber-track:focus-visible .dsp-scrubber-thumb {
  opacity: 1;
  transform: scale(1);
}

.dsp-scrubber-track:focus-visible .dsp-scrubber-rail {
  outline: 2px solid var(--dsp-bar);
  outline-offset: 3px;
}

.dsp-scrubber-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.75;
}

.dsp-scrubber-notice {
  flex: 1;
  text-align: center;
}

.dsp-scrubber-restart {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font-size: 15px;
  line-height: 1;
  padding: 4px;
  margin: -4px;
  border-radius: 4px;
  cursor: pointer;
}

.dsp-scrubber-restart:focus-visible {
  outline: 2px solid var(--dsp-bar);
}

/* ---- scene: the player on a band of its own ground ----------------------- */

/* As wide as its container and a little taller than the player. */
.dsp-scene {
  --dsp-player-max: 520px;
  position: relative;
  width: 100%;
  container-type: inline-size;
  overflow: hidden;
  isolation: isolate;
}

/* The player's square, centered. Lengths here are in cqw of the scene. */
.dsp-scene > .dsp-frame {
  width: min(100cqw, var(--dsp-player-max));
  margin: calc(min(100cqw, var(--dsp-player-max)) * 0.07) auto;
  overflow: visible;
  border-radius: 0;
}

/* In a scene the backdrop is the ground, so the stage shows through to it. */
.dsp-scene .dsp-stage {
  overflow: visible;
  border-radius: 0;
  background: transparent;
}

/*
 * The wide ground. It is 400cqw by 160cqw of the player and centered on it, so
 * the player's square is the box from 150cqw to 250cqw across and from 30cqw
 * to 130cqw down. The scene clips whatever it does not need.
 */
.dsp-backdrop {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 400cqw;
  height: 160cqw;
  margin: -80cqw 0 0 -200cqw;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.dsp-backdrop *,
.dsp-backdrop *::before,
.dsp-backdrop *::after {
  box-sizing: border-box;
}

/* A prop is an object on the ground, such as a cable. It waits for the player to appear. */
.dsp-backdrop-prop {
  transition: opacity 0.5s ease;
}

.dsp-frame[data-cover="closed"] .dsp-backdrop-prop,
.dsp-frame[data-cover="peek"] .dsp-backdrop-prop,
.dsp-frame[data-cover="closing"] .dsp-backdrop-prop {
  opacity: 0;
}
