.fd-viewer {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
  width: 100%;
  background: radial-gradient(120% 120% at 50% 10%, #12121f 0%, #08080e 55%, #050509 100%);
  border-bottom: var(--bw) solid var(--ink);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.fd-viewer:active {
  cursor: grabbing;
}

.fd-viewer:fullscreen {
  max-height: none;
  aspect-ratio: auto;
}

.fd-mount {
  position: absolute;
  inset: 0;
}

.fd-mount canvas {
  display: block;
}

.fd-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: #b9b5aa;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
}

.fd-loading[hidden] {
  display: none;
}

.fd-loadbar {
  width: 180px;
  height: 6px;
  border: 1px solid #b9b5aa;
}

.fd-loadbar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s linear;
}

.fd-controls {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 14px 16px;
}

.fd-play {
  min-width: 84px;
}

.fd-step {
  min-width: 56px;
  text-align: right;
}

.fd-size {
  display: flex;
  align-items: center;
  gap: 12px;
  grid-column: 1 / 3;
}

.fd-size input {
  max-width: 220px;
}

.fd-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.fd-btns .dbtn[aria-pressed='true'] {
  background: var(--ink);
  color: var(--bg);
}

.fd-keys {
  margin-top: 14px;
}

@media (max-width: 720px) {
  .fd-viewer {
    aspect-ratio: 4 / 3;
  }

  .fd-controls {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .fd-size,
  .fd-btns {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}
